コード例 #1
0
 /**
  * @return ProcessorInterface
  * @throws InvalidConfigurationException
  * @throws LogicException
  */
 protected function getDelegateProcessor()
 {
     if (!$this->stepExecution) {
         throw new LogicException('Step execution entity must be injected to processor.');
     }
     $context = $this->contextRegistry->getByStepExecution($this->stepExecution);
     if (!$context->getOption('processorAlias')) {
         throw new InvalidConfigurationException('Configuration of processor must contain "processorAlias" options.');
     }
     $result = $this->processorRegistry->getProcessor($this->delegateType, $context->getOption('processorAlias'));
     if ($result instanceof ContextAwareInterface) {
         $result->setImportExportContext($context);
     }
     if ($result instanceof StepExecutionAwareInterface) {
         $result->setStepExecution($this->stepExecution);
     }
     return $result;
 }
コード例 #2
0
 /**
  * @expectedException \Oro\Bundle\ImportExportBundle\Exception\UnexpectedValueException
  * @expectedExceptionMessage Processor with type "import" and alias "processor_alias" is not exist
  */
 public function testGetProcessorFails()
 {
     $this->registry->getProcessor('import', 'processor_alias');
 }