コード例 #1
0
 public function testUpdate()
 {
     $fixture = 'Hash updated';
     $job = $this->jobRepository->get(1);
     $job->hash = $fixture;
     $job->update();
     $this->assertEquals($fixture, $job->hash->getValue());
 }
コード例 #2
0
ファイル: Cancel.php プロジェクト: gudwin/extasy-schedule
 protected function action()
 {
     $job = $this->jobRepository->get($this->request->getParam('id'));
     if ($job->status->getValue() != Job::NewStatus) {
         return;
     }
     $job->status = Job::CanceledStatus;
     $job->update();
 }
コード例 #3
0
ファイル: Restart.php プロジェクト: gudwin/extasy-schedule
 protected function action()
 {
     $originalJob = $this->jobRepository->get($this->request->getParam('id'));
     if (Job::NewStatus == $originalJob->status->getValue()) {
         return $originalJob->id->getValue();
     }
     $className = get_class($originalJob);
     $job = new $className([], $this->jobRepository);
     $job->hash = $originalJob->hash->getValue();
     $job->actionDate->setTime($this->request->getParam('actionDate'));
     $job->data = $originalJob->data->getValue();
     $job->insert();
     return $job->id->getValue();
 }
コード例 #4
0
ファイル: Job.php プロジェクト: gudwin/extasy-schedule
 public function get($id)
 {
     $found = $this->repository->get($id);
     $this->setData($found->getData());
     return true;
 }