class BlockContentModerationHandler
Same name in other branches
- 9 core/modules/content_moderation/src/Entity/Handler/BlockContentModerationHandler.php \Drupal\content_moderation\Entity\Handler\BlockContentModerationHandler
- 8.9.x core/modules/content_moderation/src/Entity/Handler/BlockContentModerationHandler.php \Drupal\content_moderation\Entity\Handler\BlockContentModerationHandler
- 10 core/modules/content_moderation/src/Entity/Handler/BlockContentModerationHandler.php \Drupal\content_moderation\Entity\Handler\BlockContentModerationHandler
Customizations for block content entities.
@internal
Hierarchy
- class \Drupal\content_moderation\Entity\Handler\BlockContentModerationHandler extends \Drupal\content_moderation\Entity\Handler\ModerationHandler
Expanded class hierarchy of BlockContentModerationHandler
1 file declares its use of BlockContentModerationHandler
- EntityTypeInfo.php in core/
modules/ content_moderation/ src/ EntityTypeInfo.php
File
-
core/
modules/ content_moderation/ src/ Entity/ Handler/ BlockContentModerationHandler.php, line 13
Namespace
Drupal\content_moderation\Entity\HandlerView source
class BlockContentModerationHandler extends ModerationHandler {
/**
* {@inheritdoc}
*/
public function enforceRevisionsEntityFormAlter(array &$form, FormStateInterface $form_state, $form_id) {
$form['revision']['#default_value'] = TRUE;
$form['revision']['#disabled'] = TRUE;
$form['revision']['#description'] = $this->t('Revisions must be required when moderation is enabled.');
}
/**
* {@inheritdoc}
*/
public function enforceRevisionsBundleFormAlter(array &$form, FormStateInterface $form_state, $form_id) {
$form['revision']['#default_value'] = 1;
$form['revision']['#disabled'] = TRUE;
$form['revision']['#description'] = $this->t('Revisions must be required when moderation is enabled.');
}
/**
* {@inheritdoc}
*/
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();
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.