Class ExportFixtureCommand
Exports a table in the live database (or a range of records in it) to a fixture/init script
- CComponent
- CConsoleCommand
- ExportFixtureCommand
Package: application\commands
Author: Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/commands/ExportFixtureCommand.php
Author: Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/commands/ExportFixtureCommand.php
public
|
|
public
|
|
public
|
|
public
|
#
actionInteractive( array $args )
Export the contents of a table in the live database as a fixture or init script. |
public
|
#
actionExport( mixed $tableName, mixed $type = 'f', mixed $range = 1, mixed $columns = '*', mixed $writeCond = 's', array $aliases = array () )
Non-interactive fixture export with option to specify aliases as command line args |
__construct(),
afterAction(),
beforeAction(),
behaviors(),
buildFileList(),
confirm(),
copyFiles(),
ensureDirectory(),
getCommandRunner(),
getHelp(),
getName(),
getOptionHelp(),
init(),
onAfterAction(),
onBeforeAction(),
pluralize(),
prompt(),
renderFile(),
resolveRequest(),
run(),
usageError()
|
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
public
array
|
$args | array(
0 => array(
'tableName',
'table name',
null,
'$pass = array_key_exists($arg_in, Yii::app()->db->schema->tables);',
"Table doesn't exist"
),
1 => array(
'type',
'fixture (f) or init script (i)',
'f',
'$pass = in_array($arg_in, array("i", "f"));',
'Must be "i" or "f"'
),
2 => array(
'range',
'"WHERE" clause',
'1',
'$pass=($arg_in != null);',
'cannot be null'
),
3 => array(
'columns',
'table columns to include',
'*',
'$pass=($arg_in != null);',
'cannot be null'
),
4 => array(
'writeCond',
'overwrite (o), rename existing (r), output to stdout (s), output to file ([filename])',
's',
'$pass=true;',
'',
//'$pass=in_array($arg_in, array("o","r","s"));',
//'Must be "o", "r", or "s"'
),
) |
#
Specification for the command line arguments. Each entry takes this form: array( |
public
mixed
|
$fixtureDir |
|
$defaultAction
|
$commandRunner,
$help,
$name,
$optionHelp
|