/** * Create a job object * * @param string $title Title of the Job Object * * @return Job $job The created job */ public function createJob($title) { $job = new Job($title); $job->setJobRepository($this->jobRepository); $job->setEventDispatcher($this->eventDispatcher); return $job; }
/** * Set job * * @param Job $job * * @return \Akeneo\Bundle\BatchBundle\Entity\JobInstance */ public function setJob($job) { $this->job = $job; if ($job) { //TODO: FIXME to get only the jobConfiguration instead of merging it //with the jobConfiguration: //$this->rawConfiguration = $job->getConfiguration(); // Waiting for the ImportExport fixes on the right uses of the configuration // See https://magecore.atlassian.net/browse/BAP-2601 $jobConfiguration = $job->getConfiguration(); if (is_array($this->rawConfiguration) && count($this->rawConfiguration) > 0) { $this->rawConfiguration = array_merge($this->rawConfiguration, $jobConfiguration); } else { $this->rawConfiguration = $jobConfiguration; } } return $this; }