You are here

protected function DeleteActionDeriver::getParticipatingEntityTypes in Entity API 8.0

Same name and namespace in other branches
  1. 8 src/Plugin/Action/Derivative/DeleteActionDeriver.php \Drupal\entity\Plugin\Action\Derivative\DeleteActionDeriver::getParticipatingEntityTypes()

Gets a list of participating entity types.

The list consists of all content entity types with a delete-multiple-form link template.

Return value

\Drupal\Core\Entity\EntityTypeInterface[] The participating entity types, keyed by entity type id.

1 call to DeleteActionDeriver::getParticipatingEntityTypes()
DeleteActionDeriver::getDerivativeDefinitions in src/Plugin/Action/Derivative/DeleteActionDeriver.php
Gets the definition of all derivatives of a base plugin.

File

src/Plugin/Action/Derivative/DeleteActionDeriver.php, line 74
Contains \Drupal\entity\Plugin\Action\Derivative\DeleteActionDeriver.

Class

DeleteActionDeriver
Provides a delete action for each content entity type.

Namespace

Drupal\entity\Plugin\Action\Derivative

Code

protected function getParticipatingEntityTypes() {
  $entity_types = $this->entityTypeManager
    ->getDefinitions();
  $entity_types = array_filter($entity_types, function (EntityTypeInterface $entity_type) {
    return $entity_type
      ->isSubclassOf(ContentEntityInterface::class) && $entity_type
      ->hasLinkTemplate('delete-multiple-form');
  });
  return $entity_types;
}