protected function EntityTypeInfo::isModeratedEntityEditForm in Drupal 9
Same name and namespace in other branches
- 8 core/modules/content_moderation/src/EntityTypeInfo.php \Drupal\content_moderation\EntityTypeInfo::isModeratedEntityEditForm()
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 EntityTypeInfo::isModeratedEntityEditForm()
- EntityTypeInfo::entityPrepareForm in core/
modules/ content_moderation/ src/ EntityTypeInfo.php - Replaces the entity form entity object with a proper revision object.
- EntityTypeInfo::formAlter in core/
modules/ content_moderation/ src/ EntityTypeInfo.php - Alters bundle forms to enforce revision handling.
File
- core/
modules/ content_moderation/ src/ EntityTypeInfo.php, line 380
Class
- EntityTypeInfo
- Manipulates entity type information.
Namespace
Drupal\content_moderationCode
protected function isModeratedEntityEditForm(FormInterface $form_object) {
return $form_object instanceof ContentEntityFormInterface && in_array($form_object
->getOperation(), [
'edit',
'default',
'layout_builder',
], TRUE) && $this->moderationInfo
->isModeratedEntity($form_object
->getEntity());
}