Method |
Description |
|
__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 ( ) : DeclareSchema |
'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. |
|