/**
  * Construct to load config setting if we have cache
  */
 public function __construct($id = false, $table = null, $ds = null)
 {
     if (QueueUtil::getConfig('cache')) {
         QueueUtil::configCache();
     }
     return parent::__construct($id, $table, $ds);
 }
Exemplo n.º 2
0
 /**
  * Construct to load config setting if we have cache
  */
 public function __construct($id = false, $table = null, $ds = null)
 {
     $user_id_method = QueueUtil::getConfig('userIdMethod');
     if (!empty($user_id_method)) {
         if ($user_id = $this->{$user_id_method}()) {
             $this->data[$this->alias]['user_id'] = $user_id;
         }
     }
     return parent::__construct($id, $table, $ds);
 }
Exemplo n.º 3
0
 /**
  * QueuedTask::__construct()
  *
  * @param integer $id
  * @param string $table
  * @param string $ds
  */
 public function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     // set virtualFields
     $this->virtualFields['status'] = '(CASE WHEN ' . $this->alias . '.notbefore > NOW() THEN \'NOT_READY\' WHEN ' . $this->alias . '.fetched IS null THEN \'NOT_STARTED\' WHEN ' . $this->alias . '.fetched IS NOT null AND ' . $this->alias . '.completed IS null AND ' . $this->alias . '.failed = 0 THEN \'IN_PROGRESS\' WHEN ' . $this->alias . '.fetched IS NOT null AND ' . $this->alias . '.completed IS null AND ' . $this->alias . '.failed > 0 THEN \'FAILED\' WHEN ' . $this->alias . '.fetched IS NOT null AND ' . $this->alias . '.completed IS NOT null THEN \'COMPLETED\' ELSE \'UNKNOWN\' END)';
 }