Ejemplo n.º 1
0
 /**
  * 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;
 }
 function it_sets_the_job(Job $job)
 {
     $job->getConfiguration()->shouldBeCalled();
     $this->setJob($job);
 }
Ejemplo n.º 3
0
 /**
  * Set job
  *
  * @param Job $job
  *
  * @return 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;
 }