function ModerationInformation::shouldModerateEntitiesOfBundle

Same name and namespace in other branches
  1. 11.x core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::shouldModerateEntitiesOfBundle()
  2. 10 core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::shouldModerateEntitiesOfBundle()
  3. 8.9.x core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::shouldModerateEntitiesOfBundle()

File

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

Class

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

Namespace

Drupal\content_moderation

Code

public function shouldModerateEntitiesOfBundle(EntityTypeInterface $entity_type, $bundle) {
  if ($this->canModerateEntitiesOfEntityType($entity_type)) {
    $bundles = $this->bundleInfo
      ->getBundleInfo($entity_type->id());
    return isset($bundles[$bundle]['workflow']);
  }
  return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.