Inheritance diagram for ModelTask:

Public Member Functions | |
| __interactive () | |
| bake ($name, $associations=array(), $validate=array(), $primaryKey= 'id', $useTable=null, $useDbConfig= 'default') | |
| bakeTest ($className, $useTable=null, $associations=array()) | |
| doAssociations (&$model, $interactive=true) | |
| doValidation (&$model, $interactive=true) | |
| execute () | |
| fixture ($model, $useTable=null) | |
| getName ($useDbConfig) | |
| help () | |
| listAll ($useDbConfig= 'default', $interactive=true) | |
Public Attributes | |
| $path = MODELS | |
| $plugin = null | |
| $tasks = array('DbConfig') | |
Definition at line 34 of file model.php.
| ModelTask::__interactive | ( | ) |
Handles interactive baking
private
Definition at line 80 of file model.php.
References Shell::$name, __(), Shell::_checkUnitTest(), bake(), bakeTest(), doAssociations(), doValidation(), ConnectionManager::getDataSource(), getName(), Shell::hr(), App::import(), Shell::in(), name(), Shell::out(), and tableize().
Referenced by execute().
| ModelTask::bake | ( | $ | name, | |
| $ | associations = array(), |
|||
| $ | validate = array(), |
|||
| $ | primaryKey = 'id', |
|||
| $ | useTable = null, |
|||
| $ | useDbConfig = 'default' | |||
| ) |
Assembles and writes a Model file.
| mixed | $name Model name or object | |
| mixed | $associations if array and $name is not an object assume Model associations array otherwise boolean interactive | |
| array | $validate Validation rules | |
| string | $primaryKey Primary key to use | |
| string | $useTable Table to use | |
| string | $useDbConfig Database configuration setting to use private |
Definition at line 514 of file model.php.
References $filename, Shell::$name, $out, Shell::createFile(), doAssociations(), doValidation(), Shell::out(), tableize(), and underscore().
Referenced by __interactive(), and execute().
| ModelTask::bakeTest | ( | $ | className, | |
| $ | useTable = null, |
|||
| $ | associations = array() | |||
| ) |
Assembles and writes a unit test file
| string | $className Model class name private |
Definition at line 678 of file model.php.
References Shell::$className, Set::extract(), fixture(), and underscore().
Referenced by __interactive(), and execute().
| ModelTask::doAssociations | ( | &$ | model, | |
| $ | interactive = true | |||
| ) |
Handles associations
| object | $model | |
| boolean | $interactive |
Definition at line 304 of file model.php.
References Shell::$alias, $bad, Shell::$className, Shell::$interactive, __(), Shell::_modelKey(), Shell::_modelName(), Shell::_modelNameFromKey(), a(), Shell::hr(), App::import(), Shell::in(), name(), Shell::out(), and tableize().
Referenced by __interactive(), and bake().
| ModelTask::doValidation | ( | &$ | model, | |
| $ | interactive = true | |||
| ) |
Handles associations
| object | $model | |
| boolean | $interactive |
Definition at line 222 of file model.php.
References Shell::$interactive, Shell::in(), and Shell::out().
Referenced by __interactive(), and bake().
| ModelTask::execute | ( | ) |
Execution method always used for tasks
public
Definition at line 61 of file model.php.
References __interactive(), Shell::_checkUnitTest(), bake(), bakeTest(), and camelize().
| ModelTask::fixture | ( | $ | model, | |
| $ | useTable = null | |||
| ) |
Builds the tests fixtures for the model and create the file
| string | $model the name of the model | |
| string | $useTable table name |
Definition at line 833 of file model.php.
References $filename, $out, $path, App::import(), tableize(), and underscore().
Referenced by bakeTest().
| ModelTask::getName | ( | $ | useDbConfig | ) |
Forces the user to specify the model he wants to bake, and returns the selected model name.
Definition at line 783 of file model.php.
References __().
Referenced by __interactive().
| ModelTask::help | ( | ) |
| ModelTask::listAll | ( | $ | useDbConfig = 'default', |
|
| $ | interactive = true | |||
| ) |
outputs the a list of possible models or controllers from database
| string | $useDbConfig Database configuration name public |
Definition at line 747 of file model.php.
References __(), config(), and ConnectionManager::getDataSource().
| ModelTask::$tasks = array('DbConfig') |
1.4.7