EntityFormInterface::setEntity

public EntityFormInterface::setEntity(EntityInterface $entity)

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\EntityFormInterface::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.

Return value

$this

File

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

Class

EntityFormInterface
Defines an interface for entity form classes.

Namespace

Drupal\Core\Entity

Code

public function setEntity(EntityInterface $entity);
doc_Drupal
2016-10-29 09:06:27
Comments
Leave a Comment

Please login to continue.