You are here

public function ContentEntityForm::form in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::form()

Gets the actual form array to be built.

Overrides EntityForm::form

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

8 calls to ContentEntityForm::form()
AccountForm::form in core/modules/user/src/AccountForm.php
Gets the actual form array to be built.
BlockContentForm::form in core/modules/block_content/src/BlockContentForm.php
Gets the actual form array to be built.
CommentForm::form in core/modules/comment/src/CommentForm.php
Gets the actual form array to be built.
EntityTestForm::form in core/modules/system/tests/modules/entity_test/src/EntityTestForm.php
Gets the actual form array to be built.
MenuLinkContentForm::form in core/modules/menu_link_content/src/Form/MenuLinkContentForm.php
Gets the actual form array to be built.

... See full list

10 methods override ContentEntityForm::form()
AccountForm::form in core/modules/user/src/AccountForm.php
Gets the actual form array to be built.
BlockContentForm::form in core/modules/block_content/src/BlockContentForm.php
Gets the actual form array to be built.
BookOutlineForm::form in core/modules/book/src/Form/BookOutlineForm.php
Gets the actual form array to be built.
CommentForm::form in core/modules/comment/src/CommentForm.php
Gets the actual form array to be built.
ContentEntityConfirmFormBase::form in core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
Gets the actual form array to be built.

... See full list

File

core/lib/Drupal/Core/Entity/ContentEntityForm.php, line 51
Contains \Drupal\Core\Entity\ContentEntityForm.

Class

ContentEntityForm
Entity form variant for content entity types.

Namespace

Drupal\Core\Entity

Code

public function form(array $form, FormStateInterface $form_state) {
  $form = parent::form($form, $form_state);

  // Content entity forms do not use the parent's #after_build callback
  // because they only need to rebuild the entity in the validation and the
  // submit handler because Field API uses its own #after_build callback for
  // its widgets.
  unset($form['#after_build']);
  $this
    ->getFormDisplay($form_state)
    ->buildForm($this->entity, $form, $form_state);

  // Allow modules to act before and after form language is updated.
  $form['#entity_builders']['update_form_langcode'] = [
    $this,
    'updateFormLangcode',
  ];
  return $form;
}