コード例 #1
0
ファイル: Scheduler.php プロジェクト: rickymathew/TYPO3.CMS
 /**
  * Adds a task to the pool
  *
  * @param Task\AbstractTask $task The object representing the task to add
  * @return bool TRUE if the task was successfully added, FALSE otherwise
  */
 public function addTask(Task\AbstractTask $task)
 {
     $taskUid = $task->getTaskUid();
     if (empty($taskUid)) {
         $fields = array('crdate' => $GLOBALS['EXEC_TIME'], 'disable' => $task->isDisabled(), 'description' => $task->getDescription(), 'task_group' => $task->getTaskGroup(), 'serialized_task_object' => 'RESERVED');
         $result = $this->getDatabaseConnection()->exec_INSERTquery('tx_scheduler_task', $fields);
         if ($result) {
             $task->setTaskUid($this->getDatabaseConnection()->sql_insert_id());
             $task->save();
             $result = true;
         } else {
             $result = false;
         }
     } else {
         $result = false;
     }
     return $result;
 }
コード例 #2
0
ファイル: Scheduler.php プロジェクト: samuweiss/TYPO3-Site
 /**
  * Adds a task to the pool
  *
  * @param \TYPO3\CMS\Scheduler\Task\AbstractTask $task The object representing the task to add
  * @return boolean TRUE if the task was successfully added, FALSE otherwise
  */
 public function addTask(\TYPO3\CMS\Scheduler\Task\AbstractTask $task)
 {
     $taskUid = $task->getTaskUid();
     if (empty($taskUid)) {
         $fields = array('crdate' => $GLOBALS['EXEC_TIME'], 'disable' => $task->isDisabled(), 'description' => $task->getDescription(), 'task_group' => $task->getTaskGroup(), 'serialized_task_object' => 'RESERVED');
         $result = $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_scheduler_task', $fields);
         if ($result) {
             $task->setTaskUid($GLOBALS['TYPO3_DB']->sql_insert_id());
             $task->save();
             $result = TRUE;
         } else {
             $result = FALSE;
         }
     } else {
         $result = FALSE;
     }
     return $result;
 }