You are here

public function ModerationInformation::shouldModerateEntitiesOfBundle in Config Entity Revisions 8.2

Determines if an entity type/bundle entities should be moderated.

Parameters

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

string $bundle: The bundle to check.

Return value

bool TRUE if an entity type/bundle entities should be moderated, FALSE otherwise.

Overrides ModerationInformation::shouldModerateEntitiesOfBundle

File

src/ModerationInformation.php, line 71

Class

ModerationInformation
Class ModerationInformation.

Namespace

Drupal\config_entity_revisions

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;
}