setStatus() public method

public setStatus ( string $status )
$status string
Esempio n. 1
0
 /**
  * Edit and save TaskInterface object
  * @param TaskInterface $task
  * @param string $time
  * @param string $command
  * @param string $status
  * @param string $comment
  * @return TaskInterface
  */
 public static function editTask($task, $time, $command, $status = TaskInterface::TASK_STATUS_ACTIVE, $comment = null)
 {
     if (!($validated_command = self::validateCommand($command))) {
         return $task;
     }
     $task->setStatus($status);
     $task->setCommand($validated_command);
     $task->setTime($time);
     if (isset($comment)) {
         $task->setComment($comment);
     }
     $task->setTsUpdated(date('Y-m-d H:i:s'));
     $task->taskSave();
     return $task;
 }