You are here

public function ModerationInformation::isModeratedEntityType in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::isModeratedEntityType()

Determines if an entity type has at least one moderated bundle.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition to check.

Return value

bool TRUE if an entity type has a moderated bundle, FALSE otherwise.

Overrides ModerationInformationInterface::isModeratedEntityType

File

core/modules/content_moderation/src/ModerationInformation.php, line 62

Class

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

Namespace

Drupal\content_moderation

Code

public function isModeratedEntityType(EntityTypeInterface $entity_type) {
  $bundles = $this->bundleInfo
    ->getBundleInfo($entity_type
    ->id());
  return !empty(array_column($bundles, 'workflow'));
}