function ModerationHandlerInterface::isModeratedEntity

Same name in other branches
  1. 10 core/modules/content_moderation/src/Entity/Handler/ModerationHandlerInterface.php \Drupal\content_moderation\Entity\Handler\ModerationHandlerInterface::isModeratedEntity()
  2. 11.x core/modules/content_moderation/src/Entity/Handler/ModerationHandlerInterface.php \Drupal\content_moderation\Entity\Handler\ModerationHandlerInterface::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.

1 method overrides ModerationHandlerInterface::isModeratedEntity()
ModerationHandler::isModeratedEntity in core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php
Determines if an entity should be moderated.

File

core/modules/content_moderation/src/Entity/Handler/ModerationHandlerInterface.php, line 40

Class

ModerationHandlerInterface
Defines operations that need to vary by entity type.

Namespace

Drupal\content_moderation\Entity\Handler

Code

public function isModeratedEntity(ContentEntityInterface $entity);

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