public function ModerationInformation::shouldModerateEntitiesOfBundle in Drupal 9
Same name and namespace in other branches
- 8 core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::shouldModerateEntitiesOfBundle()
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 ModerationInformationInterface::shouldModerateEntitiesOfBundle
1 call to ModerationInformation::shouldModerateEntitiesOfBundle()
- ModerationInformation::isModeratedEntity in core/
modules/ content_moderation/ src/ ModerationInformation.php - Determines if an entity is moderated.
File
- core/
modules/ content_moderation/ src/ ModerationInformation.php, line 79
Class
- ModerationInformation
- General service for moderation-related questions about Entity API.
Namespace
Drupal\content_moderationCode
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;
}