/** * @param $command * @return string * @throws CommandNotExistsException */ private function _getCommandString($command) { if (!$this->_commandValidator->commandExists($command)) { throw new CommandNotExistsException($command); } return $this->_consoleCommand . ' ' . $command; }
/** * Updates an existing cron task * * @param TblCronTask $cronTask CronTask to update * @param string $name Name for the cron task * @param string $description Description of the cron * @param string $command Command string (i.e.: "cache:clear") * @param string $cronExpression Cron expression {@link https://en.wikipedia.org/wiki/Cron} * @return TblCronTask * @throws CommandNotExistsException */ public function update(TblCronTask &$cronTask, $name, $description, $command, $cronExpression) { if (!$this->_commandValidator->commandExists($command)) { throw new CommandNotExistsException($command); } $cronTask->setName($name)->setDescription($description)->setCommand($command)->setCronExpression($cronExpression); $this->_entityManager->flush($cronTask); return $cronTask; }