lithium\console\command\Create::_execute()
Execute the given sub-command for the current request.
Parameters
-
string
$command
The sub-command name. example: Model, Controller, Test
Returns
booleanSource
protected function _execute($command) {
try {
if (!$class = $this->_instance($command)) {
return false;
}
} catch (ClassNotFoundException $e) {
return false;
}
$data = [];
$params = $class->invokeMethod('_params');
foreach ($params as $param) {
$data[$param] = $class->invokeMethod("_{$param}", [$this->request]);
}
if ($message = $class->invokeMethod('_save', [$data])) {
$this->out($message);
return true;
}
return false;
}