You are here

protected function EntityProcessorBase::getEntityGlobalReference in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Processors/Entity/EntityProcessorBase.php \Drupal\content_synchronizer\Processors\Entity\EntityProcessorBase::getEntityGlobalReference()
  2. 3.x src/Processors/Entity/EntityProcessorBase.php \Drupal\content_synchronizer\Processors\Entity\EntityProcessorBase::getEntityGlobalReference()

Get the global reference entity.

Parameters

\Drupal\Core\Entity\Entity $entityToExport: The entity to export.

Return value

string The gid.

1 call to EntityProcessorBase::getEntityGlobalReference()
EntityProcessorBase::export in src/Processors/Entity/EntityProcessorBase.php
Export the entity and return the gid if exists, else false.

File

src/Processors/Entity/EntityProcessorBase.php, line 508

Class

EntityProcessorBase
The entity processor base.

Namespace

Drupal\content_synchronizer\Processors\Entity

Code

protected function getEntityGlobalReference(Entity $entityToExport) {
  $gid = $this
    ->getGlobalReferenceManager()
    ->getEntityGlobalId($entityToExport);
  if (!$gid) {
    $gid = $this
      ->getGlobalReferenceManager()
      ->createEntityGlobalId($entityToExport);
  }
  return $gid;
}