You are here

public function GlobalReferenceManager::onEntityDelete in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Service/GlobalReferenceManager.php \Drupal\content_synchronizer\Service\GlobalReferenceManager::onEntityDelete()
  2. 3.x src/Service/GlobalReferenceManager.php \Drupal\content_synchronizer\Service\GlobalReferenceManager::onEntityDelete()

Delete the gid on entity deletion.

File

src/Service/GlobalReferenceManager.php, line 145

Class

GlobalReferenceManager
The global reference manager.

Namespace

Drupal\content_synchronizer\Service

Code

public function onEntityDelete(Entity $entity) {
  \Drupal::database()
    ->delete(self::GID_TABLE_NAME)
    ->condition(self::FIELD_ENTITY_ID, $entity
    ->id())
    ->condition(self::FIELD_ENTITY_TYPE, $entity
    ->getEntityTypeId())
    ->execute();
}