コード例 #1
0
 /**
  * Create a jobExecution
  *
  * @param JobInstance   $jobInstance
  * @param UserInterface $user
  *
  * @return JobExecution
  */
 protected function createJobExecution(JobInstance $jobInstance, UserInterface $user)
 {
     $jobExecution = $this->jobRepository->createJobExecution($jobInstance);
     $jobExecution->setUser($user->getUsername());
     $this->jobRepository->updateJobExecution($jobExecution);
     return $jobExecution;
 }
コード例 #2
0
 /**
  * Create a jobExecution
  *
  * @param JobInstance   $jobInstance
  * @param UserInterface $user
  *
  * @return JobExecution
  */
 protected function createJobExecution(JobInstance $jobInstance, UserInterface $user)
 {
     $job = $this->jobRegistry->get($jobInstance->getJobName());
     $jobParameters = $this->jobParametersFactory->create($job, $jobInstance->getRawParameters());
     $jobExecution = $this->jobRepository->createJobExecution($jobInstance, $jobParameters);
     $jobExecution->setUser($user->getUsername());
     $this->jobRepository->updateJobExecution($jobExecution);
     return $jobExecution;
 }