public function EntityFormControllerInterface::setEntity

Sets the form entity.

Sets the form entity which will be used for populating form element defaults. Usually, the form entity gets updated by \Drupal\Core\Entity\EntityFormControllerInterface::submit(), however this may be used to completely exchange the form entity, e.g. when preparing the rebuild of a multi-step form.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity the current form should operate upon.

array $form_state: An associative array containing the current state of the form.

1 method overrides EntityFormControllerInterface::setEntity()

File

drupal/core/lib/Drupal/Core/Entity/EntityFormControllerInterface.php, line 92
Definition of Drupal\Core\Entity\EntityFormControllerInterface.

Class

EntityFormControllerInterface
Defines a common interface for entity form controller classes.

Namespace

Drupal\Core\Entity

Code

public function setEntity(EntityInterface $entity, array &$form_state);