Esempio n. 1
0
 /**
  * Add task to queue
  * @param Task $task
  * @return int Task id
  */
 public function add_task(Task $task)
 {
     if ($task->have_subtasks()) {
         if ($task->get_subtasks_quantity() == null) {
             $task->set_subtasks_quantity($task->sub_tasks()->count());
         }
         if ($task->get_subtasks_quantity_not_performed() == null) {
             $task->set_subtasks_quantity_not_performed($task->sub_tasks()->count());
         }
     }
     return $this->driver->add_task($task);
 }