本文整理汇总了PHP中Command::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::setName方法的具体用法?PHP Command::setName怎么用?PHP Command::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command
的用法示例。
在下文中一共展示了Command::setName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add($name, $description = null, $handler = null)
{
$command = new Command();
$command->setName($name);
$command->setDescription($description);
$command->setHandler($handler);
$this->addCommand($command);
return $command;
}
示例2: updateCmdInfo
/**
* @param Command $cmd
*/
private function updateCmdInfo(Command $cmd)
{
// TODO check cmd_teamid in grantedTeams
$cmd_teamid = Tools::getSecurePOSTIntValue('cmd_teamid');
if ($cmd_teamid != $this->teamid) {
// switch team (because you won't find the cmd in current team's contract list)
$_SESSION['teamid'] = $cmd_teamid;
$this->updateTeamSelector();
}
$cmd->setTeamid($cmd_teamid);
$formattedValue = Tools::getSecurePOSTStringValue('cmdName');
// TODO UGLY WORKAROUND: command name cannot contain commas (,) because it is used as field separator in FilterManager
$formattedValue = str_replace(",", ' ', $formattedValue);
$cmd->setName($formattedValue);
$formattedValue = Tools::getSecurePOSTStringValue('cmdReference', '');
$cmd->setReference($formattedValue);
$formattedValue = Tools::getSecurePOSTStringValue('cmdVersion', '');
$cmd->setVersion($formattedValue);
$formattedValue = Tools::getSecurePOSTStringValue('cmdReporter', '');
$cmd->setReporter($formattedValue);
$formattedValue = Tools::getSecurePOSTStringValue('cmdDesc', '');
$cmd->setDesc($formattedValue);
$formattedValue = Tools::getSecurePOSTStringValue('cmdStartDate', '');
if ('' != $formattedValue) {
$cmd->setStartDate(Tools::date2timestamp($formattedValue));
}
$formattedValue = Tools::getSecurePOSTStringValue('cmdDeadline', '');
if ('' != $formattedValue) {
$cmd->setDeadline(Tools::date2timestamp($formattedValue));
}
$cmd->setState(SmartyTools::checkNumericValue($_POST['cmdState'], true));
$cmd->setAverageDailyRate(SmartyTools::checkNumericValue($_POST['cmdAverageDailyRate'], true));
$cmd->setTotalSoldDays(SmartyTools::checkNumericValue($_POST['cmdTotalSoldDays'], true));
}