public function ModerationHandler::isModeratedEntity in Drupal 9
Same name and namespace in other branches
- 10 core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php \Drupal\content_moderation\Entity\Handler\ModerationHandler::isModeratedEntity()
Determines if an entity should be moderated.
At the workflow level, moderation is enabled or disabled for entire entity types or bundles. After a bundle has been enabled, there maybe be further decisions each entity type may make to evaluate if a given entity is appropriate to be included in a moderation workflow. The handler is only consulted after the user has configured the associated entity type and bundle to be included in a moderation workflow.
Returning FALSE will remove the moderation state field widget from the associated entity form and opt out of all moderation related entity semantics, such as creating new revisions and changing the publishing status of a revision.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity we may be moderating.
Return value
bool TRUE if this entity should be moderated, FALSE otherwise.
Overrides ModerationHandlerInterface::isModeratedEntity
1 method overrides ModerationHandler::isModeratedEntity()
- BlockContentModerationHandler::isModeratedEntity in core/
modules/ content_moderation/ src/ Entity/ Handler/ BlockContentModerationHandler.php - Determines if an entity should be moderated.
File
- core/
modules/ content_moderation/ src/ Entity/ Handler/ ModerationHandler.php, line 34
Class
- ModerationHandler
- Common customizations for most/all entities.
Namespace
Drupal\content_moderation\Entity\HandlerCode
public function isModeratedEntity(ContentEntityInterface $entity) {
// Moderate all entities included in the moderation workflow by default.
return TRUE;
}