ModerationInformation::isModeratedEntity

public ModerationInformation::isModeratedEntity(EntityInterface $entity) Determines if an entity is moderated. Parameters \Drupal\Core\Entity\EntityInterface $entity: The entity we may be moderating. Return value bool TRUE if this entity is moderated, FALSE otherwise. Overrides ModerationInformationInterface::isModeratedEntity File core/modules/content_moderation/src/ModerationInformation.php, line 37 Class ModerationInformation General service for moderation-related questions about Enti

ModerationInformation::isLiveRevision

public ModerationInformation::isLiveRevision(ContentEntityInterface $entity) Determines if an entity is "live". A "live" entity revision is one whose latest revision is also the default, and whose moderation state, if any, is a published state. Parameters \Drupal\Core\Entity\ContentEntityInterface $entity: The entity to check. Return value bool TRUE if the specified entity is a live revision, FALSE otherwise. Overrides ModerationInformationInterface::isLiveRevision File core/modules/content_m

ModerationInformation::hasForwardRevision

public ModerationInformation::hasForwardRevision(ContentEntityInterface $entity) Determines if a forward revision exists for the specified entity. Parameters \Drupal\Core\Entity\ContentEntityInterface $entity: The entity which may or may not have a forward revision. Return value bool TRUE if this entity has forward revisions available, FALSE otherwise. Overrides ModerationInformationInterface::hasForwardRevision File core/modules/content_moderation/src/ModerationInformation.php, line 117 C

ModerationInformation::getDefaultRevisionId

public ModerationInformation::getDefaultRevisionId($entity_type_id, $entity_id) Returns the revision ID of the default revision for the specified entity. Parameters string $entity_type_id: The entity type ID. int $entity_id: The entity ID. Return value int The revision ID of the default revision, or NULL if the entity was not found. Overrides ModerationInformationInterface::getDefaultRevisionId File core/modules/content_moderation/src/ModerationInformation.php, line 94 Class ModerationInf

ModerationInformation::canModerateEntitiesOfEntityType

public ModerationInformation::canModerateEntitiesOfEntityType(EntityTypeInterface $entity_type) Determines if an entity type can have moderated entities. Parameters \Drupal\Core\Entity\EntityTypeInterface $entity_type: An entity type object. Return value bool TRUE if this entity type can have moderated entities, FALSE otherwise. Overrides ModerationInformationInterface::canModerateEntitiesOfEntityType File core/modules/content_moderation/src/ModerationInformation.php, line 48 Class Modera

ModerationInformation::$entityTypeManager

The entity type manager. Type: \Drupal\Core\Entity\EntityTypeManagerInterface File core/modules/content_moderation/src/ModerationInformation.php, line 20 Class ModerationInformation General service for moderation-related questions about Entity API. Namespace Drupal\content_moderation Code protected $entityTypeManager;

ModerationInformation

General service for moderation-related questions about Entity API. Hierarchy class \Drupal\content_moderation\ModerationInformation implements ModerationInformationInterface File core/modules/content_moderation/src/ModerationInformation.php, line 13 Namespace Drupal\content_moderation Members Name Modifiers Type Description ModerationInformation::$entityTypeManager protected property The entity type manager. ModerationInformation::canModerateEntitiesOfEntityType publ

ModerationHandlerInterface::onPresave

public ModerationHandlerInterface::onPresave(ContentEntityInterface $entity, $default_revision, $published_state) Operates on moderated content entities preSave(). Parameters \Drupal\Core\Entity\ContentEntityInterface $entity: The entity to modify. bool $default_revision: Whether the new revision should be made the default revision. bool $published_state: Whether the state being transitioned to is a published state or not. File core/modules/content_moderation/src/Entity/Handler/ModerationHandl

ModerationHandlerInterface::onBundleModerationConfigurationFormSubmit

public ModerationHandlerInterface::onBundleModerationConfigurationFormSubmit(ConfigEntityInterface $bundle) Operates on the bundle definition that has been marked as moderated. Note: The values on the EntityModerationForm itself are already saved so do not need to be saved here. If any changes are made to the bundle object here it is this method's responsibility to call save() on it. The most common use case is to force revisions on for this bundle if moderation is enabled. That, sadly, does no

ModerationHandlerInterface::enforceRevisionsEntityFormAlter

public ModerationHandlerInterface::enforceRevisionsEntityFormAlter(array &$form, FormStateInterface $form_state, $form_id) Alters entity forms to enforce revision handling. Parameters array $form: An associative array containing the structure of the form. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. string $form_id: The form id. See also hook_form_alter() File core/modules/content_moderation/src/Entity/Handler/ModerationHandlerInterface.php, line 57