Beispiel #1
0
 /**
  * creates a mapped job from another (basically clones it)
  *
  * @param JobInterface $job         the job to clone
  * @param string       $mappedClass FQCN of the entity to map the result to
  *
  * @return self
  */
 public static function createFrom(JobInterface $job, $mappedClass, RepositoryFactoryInterface $repositoryFactory = null)
 {
     $mappedJob = new MappedJob($job->getServiceName(), $job->getRequest(), $mappedClass);
     $mappedJob->setMethod($job->getMethod());
     $mappedJob->setBody($job->getBody());
     if (null !== $repositoryFactory) {
         $mappedJob->setEntityRepository($repositoryFactory->getRepositoryForEntity($mappedClass));
     }
     return $mappedJob;
 }