You are here

protected function ConfigEntityRevisionsEntityTypeInfo::isModeratedEntityEditForm in Config Entity Revisions 8.2

Checks whether the specified form allows to edit a moderated entity.

Parameters

\Drupal\Core\Form\FormInterface $form_object: The form object.

Return value

bool TRUE if the form should get form moderation, FALSE otherwise.

2 calls to ConfigEntityRevisionsEntityTypeInfo::isModeratedEntityEditForm()
ConfigEntityRevisionsEntityTypeInfo::entityPrepareForm in src/ConfigEntityRevisionsEntityTypeInfo.php
Replaces the entity form entity object with a proper revision object.
ConfigEntityRevisionsEntityTypeInfo::formAlter in src/ConfigEntityRevisionsEntityTypeInfo.php
Alters bundle forms to enforce revision handling.

File

src/ConfigEntityRevisionsEntityTypeInfo.php, line 202

Class

ConfigEntityRevisionsEntityTypeInfo
Class ConfigEntityRevisionsEntityTypeInfo.

Namespace

Drupal\config_entity_revisions

Code

protected function isModeratedEntityEditForm(FormInterface $form_object) {
  if ($form_object instanceof ConfigEntityRevisionsEditFormInterface && in_array($form_object
    ->getOperation(), [
    'edit',
    'default',
  ], TRUE)) {
    return $this
      ->shouldModerateConfigEntity($form_object
      ->getEntity());
  }
  return parent::isModeratedEntityEditForm($form_object);
}