/**
  * {@inheritdoc}
  */
 public function process($item)
 {
     if ($this->strategy) {
         $this->strategy->setImportExportContext($this->importExportContext);
         $item = $this->strategy->process($item);
     }
     return $item;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function setImportExportContext(ContextInterface $context)
 {
     $this->context = $context;
     if ($this->strategy && $this->strategy instanceof ContextAwareInterface) {
         $this->strategy->setImportExportContext($this->context);
     }
     if ($this->dataConverter && $this->dataConverter instanceof ContextAwareInterface) {
         $this->dataConverter->setImportExportContext($context);
     }
 }
Exemplo n.º 3
0
 /**
  * @param ContextInterface $context
  * @throws InvalidConfigurationException
  */
 public function setImportExportContext(ContextInterface $context)
 {
     $this->context = $context;
     $queryBuilder = $context->getOption('queryBuilder');
     if (isset($queryBuilder) && $this->dataConverter instanceof QueryBuilderAwareInterface) {
         if (!$queryBuilder instanceof QueryBuilder) {
             throw new InvalidConfigurationException(sprintf('Configuration of processor contains invalid "queryBuilder" option. ' . '"Doctrine\\ORM\\QueryBuilder" type is expected, but "%s" is given', is_object($queryBuilder) ? get_class($queryBuilder) : gettype($queryBuilder)));
         }
         $this->dataConverter->setQueryBuilder($queryBuilder);
     }
     if ($this->dataConverter && $this->dataConverter instanceof ContextAwareInterface) {
         $this->dataConverter->setImportExportContext($context);
     }
 }