class BlockContentModerationHandler in Drupal 8
Same name and namespace in other branches
- 9 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\ModerationHandler implements ModerationHandlerInterface, EntityHandlerInterface uses StringTranslationTrait
- class \Drupal\content_moderation\Entity\Handler\BlockContentModerationHandler
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 12
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.');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlockContentModerationHandler:: |
public | function |
Alters bundle forms to enforce revision handling. Overrides ModerationHandler:: |
|
BlockContentModerationHandler:: |
public | function |
Alters entity forms to enforce revision handling. Overrides ModerationHandler:: |
|
ModerationHandler:: |
public static | function |
Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface:: |
1 |
ModerationHandler:: |
public | function |
Operates on moderated content entities preSave(). Overrides ModerationHandlerInterface:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |