You are here

public function ImportEntityManager::entityDelete in Acquia Content Hub 8

Act on the entity's delete action.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity that is being deleted.

File

src/ImportEntityManager.php, line 975

Class

ImportEntityManager
Provides a service for managing imported entities' actions.

Namespace

Drupal\acquia_contenthub

Code

public function entityDelete(EntityInterface $entity) {
  $imported_entity = $this->contentHubEntitiesTracking
    ->loadImportedByDrupalEntity($entity
    ->getEntityTypeId(), $entity
    ->id());
  if (!$imported_entity) {
    return;
  }
  $imported_entity
    ->delete();
}