translator = $translator; } /** * {@inheritdoc} */ public function setPauseDuration($period) { $this->period = $period; return $this; } /** * Returns the duration of pause between two runs of the job. * * @return float */ public function getPauseDuration() { return $this->period; } /** * {@inheritdoc} */ final protected function doRun(JobDataInterface $data) { if (!$data instanceof JobData) { throw new InvalidArgumentException(sprintf('Phraseanet jobs require Phraseanet JobData, got %s.', get_class($data))); } $this->setPauseDuration($data->getTask()->getPeriod()); $this->doJob($data); } /** * Does execute the job * * @param JobData $data The data */ abstract protected function doJob(JobData $data); }