You are here

protected function EntityCdfSerializer::addToStack in Acquia Content Hub 8.2

Adds imported entity to stack.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity being imported.

string $uuid: The remote UUID.

\Drupal\depcalc\DependencyStack $stack: The dependency stack.

Throws

\Exception

1 call to EntityCdfSerializer::addToStack()
EntityCdfSerializer::processCdf in src/EntityCdfSerializer.php
Processes incoming CDF.

File

src/EntityCdfSerializer.php, line 410

Class

EntityCdfSerializer
Serialize an entity to a CDF format.

Namespace

Drupal\acquia_contenthub

Code

protected function addToStack(EntityInterface $entity, string $uuid, DependencyStack $stack) {
  $wrapper = new DependentEntityWrapper($entity);

  // Config uuids can be more fluid since they can match on id.
  if ($wrapper
    ->getUuid() != $uuid) {
    $wrapper
      ->setRemoteUuid($uuid);
  }
  $stack
    ->addDependency($wrapper);
}