You are here

public function TrackEntity::trackEntity in Acquia Content Hub 8.2

Tracks entities being saved for the first time.

Parameters

\Drupal\acquia_contenthub\Event\EntityImportEvent $event: The entity import event.

Throws

\Exception

File

modules/acquia_contenthub_subscriber/src/EventSubscriber/EntityImport/TrackEntity.php, line 51

Class

TrackEntity
Tracks entities as their saved/updated.

Namespace

Drupal\acquia_contenthub_subscriber\EventSubscriber\EntityImport

Code

public function trackEntity(EntityImportEvent $event) {
  $entity = $event
    ->getEntity();
  $cdf_object = $event
    ->getEntityData();
  $hash = $cdf_object
    ->getAttribute('hash')
    ->getValue()['und'];
  $this->tracker
    ->track($entity, $hash, $cdf_object
    ->getUuid());
}