ImportExportBeforeImportRowEvent example

$config = Config::fromLog($this->logEntity);
        $overallResults = $this->logEntity->getResult();

        $this->eventDispatcher->addListener(WriteCommandExceptionEvent::class$this->onWriteException(...));

        $createEntities = $config->get('createEntities') ?? true;
        $updateEntities = $config->get('updateEntities') ?? true;

        $context->addState(Context::SKIP_TRIGGER_FLOW);

        foreach ($this->reader->read($config$resource$offset) as $row) {
            $event = new ImportExportBeforeImportRowEvent($row$config$context);
            $this->eventDispatcher->dispatch($event);
            $row = $event->getRow();

            // empty csv lines were already skipped by the reader.             // defaults are added to the raw csv row             $this->addUserDefaults($row$config);

            $record = [];
            foreach ($this->pipe->out($config$row) as $key => $value) {
                $record[$key] = $value;
            }

            
Home | Imprint | This part of the site doesn't use cookies.