You are here

public function ModerationInformation::selectRevisionableEntities in Workbench Moderation 8

Same name and namespace in other branches
  1. 8.2 src/ModerationInformation.php \Drupal\workbench_moderation\ModerationInformation::selectRevisionableEntities()

Filters an entity list to just the definitions for moderatable entities.

An entity type is moderatable only if it is both revisionable and bundable.

Parameters

\Drupal\Core\Entity\EntityTypeInterface[] $entity_types: The master entity type list filter.

Return value

\Drupal\Core\Entity\ContentEntityTypeInterface[] An array of only the content entity definitions we want to modify.

Overrides ModerationInformationInterface::selectRevisionableEntities

File

src/ModerationInformation.php, line 102

Class

ModerationInformation
General service for moderation-related questions about Entity API.

Namespace

Drupal\workbench_moderation

Code

public function selectRevisionableEntities(array $entity_types) {
  return array_filter($entity_types, function (EntityTypeInterface $type) use ($entity_types) {
    return $type instanceof ContentEntityTypeInterface && $type
      ->isRevisionable() && $type
      ->getBundleEntityType();
  });
}