Property | Type | Description | |
---|---|---|---|
$pathFragment | string | path to Model directory | |
$skipTables | array | Tables to skip when running all() | |
$tasks | array | tasks |
Property | Type | Description | |
---|---|---|---|
$_modelNames | array | Holds the model names | |
$_tables | array | Holds tables found on connection. | |
$_validations | array | Holds validation method map. |
Method | Description | |
---|---|---|
all ( ) : void | Bake all models at once. | |
applyAssociations ( |
Sync the in memory table object. | |
bake ( string $name ) : void | Generate code for the given model name. | |
bakeEntity ( |
Bake an entity class. | |
bakeFixture ( string $className, string | null $useTable = null ) : void | Interact with FixtureTask to automatically bake fixtures when baking models. | |
bakeTable ( |
Bake a table class. | |
bakeTest ( string $className ) : string | null | Assembles and writes a unit test file | |
fieldValidation ( Cake\Database\Schema\Table $schema, string $fieldName, array $metaData, string $primaryKey ) : array | Does individual field validation handling. | |
findBelongsTo ( |
Find belongsTo relations and add them to the associations list. | |
findBelongsToMany ( |
Find the BelongsToMany relations and add them to associations list | |
findHasMany ( |
Find the hasMany relations and add them to associations list | |
findTableReferencedBy ( Cake\Database\Schema\Table $schema, string $keyField ) : string | null | find the table, if any, actually referenced by the passed key field. | |
getAssociations ( |
Get the array of associations to generate. | |
getBehaviors ( |
Get behaviors | |
getCounterCache ( |
Get CounterCaches | |
getDisplayField ( |
Get the display field from the model or parameters | |
getEntityPropertySchema ( |
Returns an entity property "schema". | |
getFields ( ) : array | boolean | null | Evaluates the fields and no-fields options, and returns if, and which fields should be made accessible. | |
getHiddenFields ( |
Get the hidden fields from a model. | |
getOptionParser ( ) : Cake\Console\ConsoleOptionParser | Gets the option parser instance and configures it. | |
getPrimaryKey ( |
Get the primary key field from the model or parameters | |
getRules ( |
Generate default rules checker. | |
getTable ( string $name ) : string | Get the table name for the model being baked. | |
getTableContext ( |
Get table context for baking a given table. | |
getTableObject ( string $className, string $table ) : |
Get a model object for a class name. | |
getValidation ( |
Generate default validation rules. | |
listAll ( ) : array | Outputs the a list of possible models or controllers from database | |
listUnskipped ( ) : array | Outputs the a list of unskipped models or controllers from database | |
main ( string | null $name = null ) : void | Execution method always used for tasks |
Method | Description | |
---|---|---|
_getAllTables ( ) : array | Get an Array of all the tables in the supplied connection will halt the script if no tables are found. | |
_getPrefix ( ) : string | Models never have routing prefixes applied. |
protected _getAllTables ( ) : array | ||
return | array | Array of tables in the database. |
protected _getPrefix ( ) : string | ||
return | string |
public applyAssociations ( |
||
$model | The table to apply associations to. | |
$associations | array | The associations to append. |
return | void |
public fieldValidation ( Cake\Database\Schema\Table $schema, string $fieldName, array $metaData, string $primaryKey ) : array | ||
$schema | Cake\Database\Schema\Table | The table schema for the current field. |
$fieldName | string | Name of field to be validated. |
$metaData | array | metadata for field |
$primaryKey | string | The primary key field |
return | array | Array of validation for the field. |
public findBelongsTo ( |
||
$model | Database\Table instance of table being generated. | |
$associations | array | Array of in progress associations |
return | array | Associations with belongsTo added in. |
public findBelongsToMany ( |
||
$model | Model instance being generated | |
$associations | array | Array of in-progress associations |
return | array | Associations with belongsToMany added in. |
public findHasMany ( |
||
$model | Model instance being generated | |
$associations | array | Array of in progress associations |
return | array | Associations with hasMany added in. |
public findTableReferencedBy ( Cake\Database\Schema\Table $schema, string $keyField ) : string | null | ||
$schema | Cake\Database\Schema\Table | The table schema to find a constraint for. |
$keyField | string | The field to check for a constraint. |
return | string | null | Either the referenced table or null if the field has no constraints. |
public getAssociations ( |
||
$table | The table to get associations for. | |
return | array |
public getBehaviors ( |
||
$model | The model to generate behaviors for. | |
return | array | Behaviors |
public getCounterCache ( |
||
$model | The table to get counter cache fields for. | |
return | array | CounterCache configurations |
public getDisplayField ( |
||
$model | The model to introspect. | |
return | string |
public getEntityPropertySchema ( |
||
$model | The model to introspect. | |
return | array | The property schema |
public getHiddenFields ( |
||
$model | The model to introspect. | |
return | array | The columns to make accessible |
public getOptionParser ( ) : Cake\Console\ConsoleOptionParser | ||
return | Cake\Console\ConsoleOptionParser |
public getPrimaryKey ( |
||
$model | The model to introspect. | |
return | array | The columns in the primary key |
public getTableObject ( string $className, string $table ) : |
||
$className | string | Name of class you want model to be. |
$table | string | Table name |
return | Table instance |
public getValidation ( |
||
$model | The model to introspect. | |
$associations | array | The associations list. |
return | array | The validation rules. |
public listUnskipped ( ) : array | ||
return | array |
protected array $_tables | ||
return | array |
protected array $_validations | ||
return | array |
public array $skipTables | ||
return | array |