NodeModerationHandler
class NodeModerationHandler extends ModerationHandler (View source)
| internal |
Customizations for node entities.
Traits
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Properties
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected ModerationInformationInterface | $moderationInfo | The moderation information service. |
Methods
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Instantiates a new instance of this entity handler.
Operates on moderated content entities preSave().
Alters entity forms to enforce revision handling.
Alters bundle forms to enforce revision handling.
Details
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
static EntityHandlerInterface
createInstance(ContainerInterface $container, EntityTypeInterface $entity_type)
Instantiates a new instance of this entity handler.
This is a factory method that returns a new instance of this object. The factory should pass any needed dependencies into the constructor of this object, but not the container itself. Every call to this method must return a new instance of this object; that is, it may not implement a singleton.
onPresave(ContentEntityInterface $entity, bool $default_revision, bool $published_state)
Operates on moderated content entities preSave().
enforceRevisionsEntityFormAlter(array $form, FormStateInterface $form_state, string $form_id)
Alters entity forms to enforce revision handling.
enforceRevisionsBundleFormAlter(array $form, FormStateInterface $form_state, string $form_id)
Alters bundle forms to enforce revision handling.
__construct(ModerationInformationInterface $moderation_info)
NodeModerationHandler constructor.