You are here

public function ModerationInformation::selectRevisionableEntityTypes in Workbench Moderation 8.2

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

Filters an entity list to just bundle definitions for revisionable entities.

Parameters

EntityTypeInterface[] $entity_types: The master entity type list filter.

Return value

ConfigEntityTypeInterface[] An array of only the config entities we want to modify.

Overrides ModerationInformationInterface::selectRevisionableEntityTypes

File

src/ModerationInformation.php, line 91

Class

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

Namespace

Drupal\workbench_moderation

Code

public function selectRevisionableEntityTypes(array $entity_types) {
  return array_filter($entity_types, function (EntityTypeInterface $type) use ($entity_types) {
    return $type instanceof ConfigEntityTypeInterface && ($bundle_of = $type
      ->get('bundle_of')) && $entity_types[$bundle_of]
      ->isRevisionable();
  });
}