function EntityFormInterface::buildEntity

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityFormInterface.php \Drupal\Core\Entity\EntityFormInterface::buildEntity()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityFormInterface.php \Drupal\Core\Entity\EntityFormInterface::buildEntity()
  3. 10 core/lib/Drupal/Core/Entity/EntityFormInterface.php \Drupal\Core\Entity\EntityFormInterface::buildEntity()

Builds an updated entity object based upon the submitted form values.

For building the updated entity object the form's entity is cloned and the submitted form values are copied to entity properties. The form's entity remains unchanged.

Parameters

array $form: A nested array form elements comprising the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

\Drupal\Core\Entity\EntityInterface An updated copy of the form's entity object.

See also

\Drupal\Core\Entity\EntityFormInterface::getEntity()

3 methods override EntityFormInterface::buildEntity()
EntityForm::buildEntity in core/lib/Drupal/Core/Entity/EntityForm.php
Builds an updated entity object based upon the submitted form values.
RevisionDeleteForm::buildEntity in core/lib/Drupal/Core/Entity/Form/RevisionDeleteForm.php
Builds an updated entity object based upon the submitted form values.
RevisionRevertForm::buildEntity in core/lib/Drupal/Core/Entity/Form/RevisionRevertForm.php
Builds an updated entity object based upon the submitted form values.

File

core/lib/Drupal/Core/Entity/EntityFormInterface.php, line 90

Class

EntityFormInterface
Defines an interface for entity form classes.

Namespace

Drupal\Core\Entity

Code

public function buildEntity(array $form, FormStateInterface $form_state);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.