/** * @param JobInterface $job * @param string $jobType * @param string $connector * * @throws DuplicatedJobException */ public function register(JobInterface $job, $jobType, $connector) { if (isset($this->jobs[$job->getName()])) { throw new DuplicatedJobException(sprintf('The job "%s" is already registered', $job->getName())); } $this->jobs[$job->getName()] = $job; $this->jobsByType[$jobType][$job->getName()] = $job; $this->jobsByTypeGroupByConnector[$jobType][$connector][$job->getName()] = $job; $this->jobsByConnector[$connector][$job->getName()] = $job; }
/** * @param JobInterface $child */ public function add(JobInterface $child) { $child->setParent($this); $this->children[$child->getName()] = $child; }
public function create(JobInterface $job, $input, $current, Metadata $metadata = null) { return new JobContext($job->getName(), $input, $current, $job->getContextOption(), $job->getOptions(), $metadata); }