/** * {@inheritdoc} */ public function process($item) { if ($this->dataConverter) { $item = $this->dataConverter->convertToImportFormat($item, false); } $this->context->setValue('itemData', $item); $object = $this->serializer->deserialize($item, $this->context->getOption('entityName'), null, $this->context->getConfiguration()); if ($this->strategy) { $object = $this->strategy->process($object); } return $object ?: null; }
/** * {@inheritdoc} */ public function setImportExportContext(ContextInterface $context) { $this->context = $context; if ($context->hasOption('gridName')) { $this->grid = $this->gridManagerLink->getService()->getDatagrid($context->getOption('gridName'), $context->getOption('gridParameters')); $context->setValue('columns', $this->grid->getConfig()->offsetGet('columns')); } else { throw new InvalidConfigurationException('Configuration of datagrid export reader must contain "gridName".'); } }