Пример #1
0
 /**
  * @param \Abc\Bundle\JobBundle\Job\JobInterface $job
  * @param JobManagerInterface                    $manager
  * @param integer                                $interval The minimum number of seconds that must have been passed between two refresh operations
  * @throws \InvalidArgumentException If interval is not greater than of equal to zero
  */
 public function __construct(\Abc\Bundle\JobBundle\Job\JobInterface $job, JobManagerInterface $manager, $interval)
 {
     if ((int) $interval < 0) {
         throw new \InvalidArgumentException('$interval must be greater than or equal to zero');
     }
     $class = $manager->getClass();
     if (!$job instanceof $class) {
         throw new \InvalidArgumentException('The given $job is not managed by the given $manager, $job must be an instance of' . $class);
     }
     $this->job = $job;
     $this->manager = $manager;
     $this->interval = $interval;
 }