You are here

public static function LocalTask::postDelete in Translation Management Tool 8

Acts on deleted entities before the delete hook is invoked.

Used after the entities are deleted but before invoking the delete hook.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.

\Drupal\Core\Entity\EntityInterface[] $entities: An array of entities.

Overrides EntityBase::postDelete

File

translators/tmgmt_local/src/Entity/LocalTask.php, line 384

Class

LocalTask
Entity class for the local task entity.

Namespace

Drupal\tmgmt_local\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $entities) {
  parent::postDelete($storage, $entities);
  $ids = \Drupal::entityQuery('tmgmt_local_task_item')
    ->condition('tltid', array_keys($entities), 'IN')
    ->execute();
  if (!empty($ids)) {
    $storage_handler = \Drupal::entityTypeManager()
      ->getStorage('tmgmt_local_task_item');
    $entities = $storage_handler
      ->loadMultiple($ids);
    $storage_handler
      ->delete($entities);
  }
}