本文整理汇总了PHP中CommandFactory::get_command方法的典型用法代码示例。如果您正苦于以下问题:PHP CommandFactory::get_command方法的具体用法?PHP CommandFactory::get_command怎么用?PHP CommandFactory::get_command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandFactory
的用法示例。
在下文中一共展示了CommandFactory::get_command方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCommand
/**
* Returns the requested command and assigns the controller class to its
* owner/caller. See @link CommandFactory for more details.
* @param $commandName string name of the command
* @param $data array|null list of parameters for the command. The array
* structure is specific to the command.
*
* @return ControllerCommand the requested command.
* @throws CommandController_Exception
*/
function getCommand($commandName, $data = null)
{
if ($data && !is_array($data)) {
throw new CommandController_Exception('Invalid command parameters.');
}
try {
$command = CommandFactory::get_command($commandName, $this->owner, $data);
} catch (CommandFactory_Exception $e) {
throw new CommandController_Exception($e->getMessage());
}
return $command;
}