You are here

public function EntityForm::getEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/EntityForm.php \Drupal\Core\Entity\EntityForm::getEntity()
  2. 9 core/lib/Drupal/Core/Entity/EntityForm.php \Drupal\Core\Entity\EntityForm::getEntity()

Gets the form entity.

The form entity which has been used for populating form element defaults.

Return value

\Drupal\Core\Entity\EntityInterface The current form entity.

Overrides EntityFormInterface::getEntity

13 calls to EntityForm::getEntity()
AccountForm::submitForm in core/modules/user/src/AccountForm.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…
BundleEntityFormBase::protectBundleIdElement in core/lib/Drupal/Core/Entity/BundleEntityFormBase.php
Protects the bundle entity's ID property's form element against changes.
DefaultsEntityForm::getBaseFormId in core/modules/layout_builder/src/Form/DefaultsEntityForm.php
Returns a string identifying the base form.
MediaTypeForm::actions in core/modules/media/src/MediaTypeForm.php
Returns an array of supported actions for the current entity form.
OverridesEntityForm::getBaseFormId in core/modules/layout_builder/src/Form/OverridesEntityForm.php
Returns a string identifying the base form.

... See full list

File

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

Class

EntityForm
Base class for entity forms.

Namespace

Drupal\Core\Entity

Code

public function getEntity() {
  return $this->entity;
}