You are here

protected function CreateStubs::handleEntityProcessing in Acquia Content Hub 8.2

Process entities and handle exceptions.

Parameters

array $unprocessed: The unprocessed array.

\Drupal\acquia_contenthub\Event\FailedImportEvent $event: The event object.

\Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher: The dispatcher.

1 call to CreateStubs::handleEntityProcessing()
CreateStubs::onImportFailure in src/EventSubscriber/ImportFailure/CreateStubs.php
Generate stub entities for all remaining content entities and reimports.

File

src/EventSubscriber/ImportFailure/CreateStubs.php, line 93

Class

CreateStubs
Class CreateStubs.

Namespace

Drupal\acquia_contenthub\EventSubscriber\ImportFailure

Code

protected function handleEntityProcessing(array $unprocessed, FailedImportEvent $event, EventDispatcherInterface $dispatcher) {
  try {
    $cdfs = $this
      ->processConfigEntities($unprocessed, $event) + $this
      ->processContentEntities($unprocessed, $event, $dispatcher);
    $document = new CDFDocument(...$cdfs);
    $event
      ->getSerializer()
      ->unserializeEntities($document, $event
      ->getStack());
    $event
      ->stopPropagation();
  } catch (\Exception $e) {
    $event
      ->setException($e);
  }
}