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 = null) { if (!$data instanceof JobData) { throw new InvalidArgumentException('JobData must be passed to a JobInterface::Run command.'); } $this->setPauseDuration($data->getTask()->getPeriod()); $this->doJob($data); } /** * Does execute the job * * @param JobData $data The data */ abstract protected function doJob(JobData $data); }