class TaxonomyTermModerationHandler

Same name in other branches
  1. 10 core/modules/content_moderation/src/Entity/Handler/TaxonomyTermModerationHandler.php \Drupal\content_moderation\Entity\Handler\TaxonomyTermModerationHandler

Customizations for taxonomy term entities.

@internal

Hierarchy

Expanded class hierarchy of TaxonomyTermModerationHandler

1 file declares its use of TaxonomyTermModerationHandler
EntityTypeInfo.php in core/modules/content_moderation/src/EntityTypeInfo.php

File

core/modules/content_moderation/src/Entity/Handler/TaxonomyTermModerationHandler.php, line 12

Namespace

Drupal\content_moderation\Entity\Handler
View source
class TaxonomyTermModerationHandler extends ModerationHandler {
    
    /**
     * {@inheritdoc}
     */
    public function enforceRevisionsEntityFormAlter(array &$form, FormStateInterface $form_state, $form_id) : void {
        $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) : void {
        $form['revision']['#default_value'] = TRUE;
        $form['revision']['#disabled'] = TRUE;
        $form['revision']['#description'] = $this->t('Revisions must be required when moderation is enabled.');
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
ModerationHandler::createInstance public static function Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface::createInstance 1
ModerationHandler::isModeratedEntity public function Determines if an entity should be moderated. Overrides ModerationHandlerInterface::isModeratedEntity 1
ModerationHandler::onPresave public function Operates on moderated content entities preSave(). Overrides ModerationHandlerInterface::onPresave
StringTranslationTrait::$stringTranslation protected property The string translation service. 3
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
TaxonomyTermModerationHandler::enforceRevisionsBundleFormAlter public function Alters bundle forms to enforce revision handling. Overrides ModerationHandler::enforceRevisionsBundleFormAlter
TaxonomyTermModerationHandler::enforceRevisionsEntityFormAlter public function Alters entity forms to enforce revision handling. Overrides ModerationHandler::enforceRevisionsEntityFormAlter

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