You are here

protected function BreakLockDeriver::getApplicableEntityTypes in Content locking (anti-concurrent editing) 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Action/BreakLockDeriver.php \Drupal\content_lock\Plugin\Action\BreakLockDeriver::getApplicableEntityTypes()

Gets a list of applicable entity types.

The list consists of all entity types which match the conditions for the given deriver. For example, if the action applies to entities that are publishable, this method will find all entity types that are publishable.

Return value

\Drupal\Core\Entity\EntityTypeInterface[] The applicable entity types, keyed by entity type ID.

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

File

src/Plugin/Action/BreakLockDeriver.php, line 82

Class

BreakLockDeriver
Provides an action deriver that finds content entity types.

Namespace

Drupal\content_lock\Plugin\Action

Code

protected function getApplicableEntityTypes() {
  $entity_types = $this->entityTypeManager
    ->getDefinitions();
  $entity_types = array_filter($entity_types, function (EntityTypeInterface $entity_type) {
    return $this
      ->isApplicable($entity_type);
  });
  return $entity_types;
}