function EntityForm::setEntity

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityForm.php \Drupal\Core\Entity\EntityForm::setEntity()
  2. 10 core/lib/Drupal/Core/Entity/EntityForm.php \Drupal\Core\Entity\EntityForm::setEntity()
  3. 11.x core/lib/Drupal/Core/Entity/EntityForm.php \Drupal\Core\Entity\EntityForm::setEntity()

Overrides EntityFormInterface::setEntity

1 call to EntityForm::setEntity()
DefaultsEntityForm::buildEntity in core/modules/layout_builder/src/Form/DefaultsEntityForm.php
Builds an updated entity object based upon the submitted form values.

File

core/lib/Drupal/Core/Entity/EntityForm.php, line 388

Class

EntityForm
Base class for entity forms.

Namespace

Drupal\Core\Entity

Code

public function setEntity(EntityInterface $entity) {
    $this->entity = $entity;
    return $this;
}

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