interface ModerationHandlerInterface (View source)

internal  
 

Defines operations that need to vary by entity type.

Much of the logic contained in this handler is an indication of flaws in the Entity API that are insufficiently standardized between entity types. Hopefully over time functionality can be removed from this interface.

Methods

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.

Details

onPresave(ContentEntityInterface $entity, bool $default_revision, bool $published_state)

Operates on moderated content entities preSave().

Parameters

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.

enforceRevisionsEntityFormAlter(array $form, FormStateInterface $form_state, string $form_id)

Alters entity forms to enforce revision handling.

Parameters

array $form

An associative array containing the structure of the form.

FormStateInterface $form_state

The current state of the form.

string $form_id

The form id.

See also

hook_form_alter()

enforceRevisionsBundleFormAlter(array $form, FormStateInterface $form_state, string $form_id)

Alters bundle forms to enforce revision handling.

Parameters

array $form

An associative array containing the structure of the form.

FormStateInterface $form_state

The current state of the form.

string $form_id

The form id.

See also

hook_form_alter()