public static function LocalTask::postDelete

File

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

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')
    ->accessCheck(TRUE)
    ->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);
  }
}