You are here

public function BlockContentModerationHandler::isModeratedEntity in Drupal 9

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 ModerationHandler::isModeratedEntity

File

core/modules/content_moderation/src/Entity/Handler/BlockContentModerationHandler.php, line 36

Class

BlockContentModerationHandler
Customizations for block content entities.

Namespace

Drupal\content_moderation\Entity\Handler

Code

public function isModeratedEntity(ContentEntityInterface $entity) {

  // Only reusable blocks can be moderated individually. Non-reusable or
  // inline blocks are moderated as part of the entity they are a composite
  // of.
  return $entity
    ->isReusable();
}