Свойство | Тип | Описание | |
---|---|---|---|
$collectionInterfaceClasses | string[] | ||
$collectionTraitClasses | string[] | ||
$enableColumnAccessors | |||
$indexes | |||
$modelInterfaceClasses | string[] | ||
$modelTraitClasses | string[] | ||
$onDelete | |||
$onUpdate |
Метод | Описание | |
---|---|---|
__construct ( array $options = [] ) | Constructor of declare schema. | |
__toString ( ) | ||
addCollectionInterface ( $iface ) | Implement interface in collection class. | |
addCollectionTrait ( $traitClass ) : ClassTemplate\ClassTrait | Use trait for the model class. | |
addColumn ( DeclareColumn $column ) : DeclareColumn | Add column object into the column list. | |
addModelInterface ( $iface ) | Implement interface in model class. | |
addModelTrait ( $traitClass ) : ClassTemplate\ClassTrait | Use trait for the model class. | |
addSeed ( string $seed ) | Add seed class. | |
belongsTo ( $accessor, string $foreignClass, string $foreignColumn = 'id', string $selfColumn = null ) | define self primary key to foreign key reference. | |
column ( string $name, string $class = 'LazyRecord\Schema\DeclareColumn' ) : DeclareColumn | Define new column object. | |
dump ( ) | ||
export ( ) | ||
findPrimaryKey ( ) : string | Find primary key from columns. | |
findPrimaryKeyColumn ( ) : DeclareColumn | Find primary key column object from columns. | |
getClassFileName ( ) | ||
getClassName ( ) | ||
getCollectionInterfaces ( ) : string[] | ||
getCollectionTraitClasses ( ) : string[] | ||
getColumn ( string $name ) | 'getColumn' gets the column object by the given column name. | |
getColumnLabels ( $includeVirtual = false ) | ||
getColumnNames ( boolean $includeVirtual = false ) : string[] | ||
getColumns ( $includeVirtual = false ) | ||
getDirectory ( ) : string | Get directory from current schema object. | |
getIndexQueries ( ) : SQLBuilder\Universal\Query\CreateIndexQuery[] | ||
getLabel ( ) | ||
getModelClass ( ) : string | Get model class name of this schema. | |
getModelInterfaces ( ) : string[] | ||
getModelTraitClasses ( ) : string[] | ||
getModificationTime ( ) : integer | Return the modification time of this schema definition class. | |
getMsgIds ( ) | ||
getPrimaryKey ( ) : string | Get the primary key column name. | |
getReadSourceId ( ) | ||
getRelatedClassPath ( string $class ) : string | Get the related class file path by the given class name. | |
getShortClassName ( ) | ||
getTable ( ) : string | Get the table name of this schema class. | |
getWriteSourceId ( ) | ||
hasColumn ( string $name ) : boolean | hasColumn method returns true if a column name is defined. | |
hasMany ( ) | ||
hasOne ( string $accessor, string $foreignClass, string $foreignColumn = null, string $selfColumn ) | has-one relationship. | |
insertColumn ( DeclareColumn $column ) | Insert column object at the begining of the column list. | |
isNewerThanFile ( string $path ) : boolean | isNewerThanFile returns true if the schema file is newer than a file. | |
label ( string $label ) | Define schema label. | |
many ( string $accessor, string $foreignClass, string $foreignColumn, string $selfColumn ) | Add has-many relation. | |
manyToMany ( string $accessor, string $relationId, string $foreignRelationId ) | ||
mixin ( string $class, array $options = [] ) | Mixin. | |
onDelete ( string $action ) | onDelete defines a software trigger of delete action. | |
onUpdate ( $action ) | onUpdate defines a software trigger of update action. | |
readFrom ( string $id ) | set data source for read. | |
removeColumn ( $columnName ) | ||
requireProxyFileUpdate ( ) : boolean | requireProxyFileUpdate returns true if the schema proxy file is out of date. | |
schema ( ) | ||
seeds ( ) : |
'seeds' helps you define seed classes. | |
table ( string $table ) | Define table name. | |
using ( string $id ) | set data source for both write and read. | |
writeTo ( string $id ) | set data source for write. |
Метод | Описание | |
---|---|---|
_classnameToTable ( ) : string | Convert current model name to a class name. | |
_modelClassToLabel ( ) | ||
build ( array $options = [] ) | Build schema build the schema by running the "schema" method. | |
disableColumnAccessors ( ) | SchemaGenerator generates column accessor methods from the column definition automatically. | |
getCurrentSchemaClass ( ) | ||
helper ( string $helperName, array $arguments = [] ) : |
Invode helper. | |
index ( $name, $columns = null, $using = null ) : SQLBuilder\Universal\Query\CreateIndexQuery | 'index' method helps you define index queries. | |
insertAutoIdPrimaryColumn ( string $name = 'id', string $columnType = 'integer' ) | Insert a primary key column with auto increment. | |
resolveSchemaClass ( $class ) |
public __construct ( array $options = [] ) | ||
$options | array |
protected _classnameToTable ( ) : string | ||
Результат | string | table name |
public addCollectionInterface ( $iface ) |
public addCollectionTrait ( $traitClass ) : ClassTemplate\ClassTrait | ||
Результат | ClassTemplate\ClassTrait | object |
public addColumn ( DeclareColumn $column ) : DeclareColumn | ||
$column | DeclareColumn | |
Результат | DeclareColumn |
public addModelInterface ( $iface ) |
public addModelTrait ( $traitClass ) : ClassTemplate\ClassTrait | ||
Результат | ClassTemplate\ClassTrait | object |
protected disableColumnAccessors ( ) |
public findPrimaryKey ( ) : string | ||
Результат | string | primary key |
public findPrimaryKeyColumn ( ) : DeclareColumn | ||
Результат | DeclareColumn |
public getCollectionInterfaces ( ) : string[] | ||
Результат | string[] |
public getCollectionTraitClasses ( ) : string[] | ||
Результат | string[] |
public getColumnNames ( boolean $includeVirtual = false ) : string[] | ||
$includeVirtual | boolean | |
Результат | string[] |
public getDirectory ( ) : string | ||
Результат | string | path |
public getIndexQueries ( ) : SQLBuilder\Universal\Query\CreateIndexQuery[] | ||
Результат | SQLBuilder\Universal\Query\CreateIndexQuery[] |
public getModelClass ( ) : string | ||
Результат | string | model class name |
public getModelTraitClasses ( ) : string[] | ||
Результат | string[] |
public getModificationTime ( ) : integer | ||
Результат | integer | timestamp |
public getPrimaryKey ( ) : string | ||
Результат | string | primary key column name |
public getRelatedClassPath ( string $class ) : string | ||
$class | string | the scheam related class name |
Результат | string | the class filepath. |
protected index ( $name, $columns = null, $using = null ) : SQLBuilder\Universal\Query\CreateIndexQuery | ||
Результат | SQLBuilder\Universal\Query\CreateIndexQuery |
protected insertAutoIdPrimaryColumn ( string $name = 'id', string $columnType = 'integer' ) | ||
$name | string | default to 'id' |
$columnType | string | 'int', 'smallint', 'bigint' ... |
public insertColumn ( DeclareColumn $column ) | ||
$column | DeclareColumn |
public isNewerThanFile ( string $path ) : boolean | ||
$path | string | |
Результат | boolean |
public onUpdate ( $action ) |
public requireProxyFileUpdate ( ) : boolean | ||
Результат | boolean |
public seeds ( ) : |
||
Результат |
public string[] $collectionInterfaceClasses | ||
Результат | string[] |
public string[] $collectionTraitClasses | ||
Результат | string[] |