ImportExportAfterImportRecordEvent example

$result = $this->repository->create([$record]$context);
                } elseif ($createEntities === false && $updateEntities === true) {
                    $result = $this->repository->update([$record]$context);
                } else {
                    // expect that both create and update are true -> upsert                     // both false isn't possible via admin (but still results in an upsert)                     $result = $this->repository->upsert([$record]$context);
                }

                $progress->addProcessedRecords(1);

                $afterRecord = new ImportExportAfterImportRecordEvent($result$record$row$config$context);
                $this->eventDispatcher->dispatch($afterRecord);
            } catch (\Throwable $exception) {
                $event = new ImportExportExceptionImportRecordEvent($exception$record$row$config$context);
                $this->eventDispatcher->dispatch($event);

                $exception = $event->getException();

                if ($exception) {
                    $record['_error'] = mb_convert_encoding($exception->getMessage(), 'UTF-8', 'UTF-8');
                    $failedRecords[] = $record;
                }
            }
Home | Imprint | This part of the site doesn't use cookies.