コード例 #1
0
ファイル: TaskService.php プロジェクト: RobbyVoid/Scheduler
 /**
  * @param string $type
  * @param Task $task
  * @return array
  */
 public function getTaskDescriptor($type, Task $task)
 {
     Assertion::string($type, 'Type must be a string');
     return array('type' => $type, 'enabled' => $task->isEnabled() ? 'On' : 'Off', 'identifier' => $this->persistenceManager->getIdentifierByObject($task), 'expression' => $task->getExpression(), 'implementation' => $task->getImplementation(), 'nextExecution' => $task->getNextExecution() ? $task->getNextExecution()->format(\DateTime::ISO8601) : '', 'nextExecutionTimestamp' => $task->getNextExecution() ? $task->getNextExecution()->getTimestamp() : 0, 'lastExecution' => $task->getLastExecution() ? $task->getLastExecution()->format(\DateTime::ISO8601) : '', 'object' => $task);
 }