/**
  * Sets status of the job to cancelled if process controller indicates to exit.
  *
  * @return boolean
  */
 public function doStop()
 {
     if ($this->controller->doStop()) {
         $this->job->setStatus(Status::CANCELLED());
         return true;
     }
     return false;
 }
Beispiel #2
0
 /**
  * Copies properties of a job to another job
  *
  * @param JobInterface                             $from The job where properties are copied from
  * @param \Abc\Bundle\JobBundle\Model\JobInterface $to   The job where where properties are copied to
  * @return \Abc\Bundle\JobBundle\Model\JobInterface The copied job
  */
 public function copyJob(JobInterface $from, \Abc\Bundle\JobBundle\Model\JobInterface $to)
 {
     $to->setType($from->getType());
     $to->setResponse($from->getResponse());
     $to->setParameters($from->getParameters());
     if (null != $from->getStatus()) {
         $to->setStatus($from->getStatus());
     }
     foreach ($from->getSchedules() as $schedule) {
         $to->addSchedule($schedule);
     }
     return $to;
 }