コード例 #1
0
 public function testEntityProperties()
 {
     $storage = new Storage();
     $dte_added = new DateTime();
     $job_data = new \stdClass();
     $job_id = '67b9a976-2edd-3e6e-adc3-22adeb5b3949';
     $lockout_handle = md5($job_id);
     $lockout_timer = new DateTime();
     $retry = 3;
     $state = 1;
     $retry_last = new DateTime();
     $storage->setDateAdded($dte_added);
     $storage->setJobData($job_data);
     $storage->setJobId($job_id);
     $storage->setLockoutHandle($lockout_handle);
     $storage->setLockoutTimer($lockout_timer);
     $storage->setRetryLeft($retry);
     $storage->setRetryLast($retry_last);
     $storage->setState($state);
     $this->assertEquals($dte_added, $storage->getDateAdded());
     $this->assertEquals($job_data, $storage->getJobData());
     $this->assertEquals($job_id, $storage->getJobId());
     $this->assertEquals($lockout_handle, $storage->getLockoutHandle());
     $this->assertEquals($lockout_timer, $storage->getLockoutTimer());
     $this->assertEquals($retry, $storage->getRetryLeft());
     $this->assertEquals($retry_last, $storage->getRetryLast());
     $this->assertEquals($state, $storage->getState());
 }
コード例 #2
0
 /**
  *  Will Query the delete a single job
  *
  *  @access public
  *  @return Response
  */
 public function deleteJobAction(Application $app, Request $req, Storage $job)
 {
     $data = array('result' => array(), 'msg' => null);
     # run against api
     $data['result'] = $this->getQueue()->remove($job->getJobId(), new DateTime());
     $data['msg'] = true;
     return $this->response($data, 200);
 }
コード例 #3
0
ファイル: Job.php プロジェクト: icomefromthenet/laterjob
 /**
  *  Return this jobs assigned unique id
  *
  *  @access public
  *  @return string the job unique id
  */
 public function getId()
 {
     return $this->storage->getJobId();
 }
コード例 #4
0
 public function toArray(Storage $entity)
 {
     return array('jobId' => $entity->getJobId(), 'retryCount' => $entity->getRetryLeft(), 'dateAdded' => $entity->getDateAdded(), 'stateId' => $entity->getState(), 'jobData' => $entity->getJobData(), 'lockTimeout' => $entity->getLockoutTimer(), 'handle' => $entity->getLockoutHandle(), 'retryLast' => $entity->getRetryLast());
 }