コード例 #1
0
ファイル: TaskService.php プロジェクト: RobbyVoid/Scheduler
 /**
  * @param Task $task
  * @return boolean
  */
 protected function assertValidTask(Task $task)
 {
     if (!class_exists($task->getImplementation())) {
         throw new \InvalidArgumentException(sprintf('Task implementation "%s" must exist', $task->getImplementation()), 1419296545);
     }
     if (!$this->reflexionService->isClassImplementationOf($task->getImplementation(), self::TASK_INTERFACE)) {
         throw new \InvalidArgumentException('Task must implement TaskInterface', 1419296485);
     }
 }
コード例 #2
0
 /**
  * Disable the given persistend class
  *
  * @param Task $task persistend task identifier, see task:list
  */
 public function disableCommand(Task $task)
 {
     $task->disable();
     $this->taskService->update($task, TaskInterface::TYPE_PERSISTED);
 }