function EntityForm::buildEntity
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Entity/EntityForm.php \Drupal\Core\Entity\EntityForm::buildEntity()
- 9 core/lib/Drupal/Core/Entity/EntityForm.php \Drupal\Core\Entity\EntityForm::buildEntity()
- 8.9.x core/lib/Drupal/Core/Entity/EntityForm.php \Drupal\Core\Entity\EntityForm::buildEntity()
6 calls to EntityForm::buildEntity()
- EntityDisplayFormBase::multistepSubmit in core/
modules/ field_ui/ src/ Form/ EntityDisplayFormBase.php - Form submission handler for multistep buttons.
- FieldConfigEditForm::validateForm in core/
modules/ field_ui/ src/ Form/ FieldConfigEditForm.php - Form validation handler.
- NodeTypeForm::buildEntity in core/
modules/ node/ src/ NodeTypeForm.php - Builds an updated entity object based upon the submitted form values.
- NodeTypeForm::buildEntity in core/
modules/ node/ src/ NodeTypeForm.php - Builds an updated entity object based upon the submitted form values.
- VocabularyForm::buildEntity in core/
modules/ taxonomy/ src/ VocabularyForm.php - Builds an updated entity object based upon the submitted form values.
5 methods override EntityForm::buildEntity()
- ContentEntityForm::buildEntity in core/
lib/ Drupal/ Core/ Entity/ ContentEntityForm.php - Builds an updated entity object based upon the submitted form values.
- DefaultsEntityForm::buildEntity in core/
modules/ layout_builder/ src/ Form/ DefaultsEntityForm.php - Builds an updated entity object based upon the submitted form values.
- FieldStorageConfigEditForm::buildEntity in core/
modules/ field_ui/ src/ Form/ FieldStorageConfigEditForm.php - Builds an updated entity object based upon the submitted form values.
- NodeTypeForm::buildEntity in core/
modules/ node/ src/ NodeTypeForm.php - Builds an updated entity object based upon the submitted form values.
- VocabularyForm::buildEntity in core/
modules/ taxonomy/ src/ VocabularyForm.php - Builds an updated entity object based upon the submitted form values.
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityForm.php, line 299
Class
- EntityForm
- Base class for entity forms.
Namespace
Drupal\Core\EntityCode
public function buildEntity(array $form, FormStateInterface $form_state) {
$entity = clone $this->entity;
$this->copyFormValuesToEntity($entity, $form, $form_state);
// Invoke all specified builders for copying form values to entity
// properties.
if (isset($form['#entity_builders'])) {
foreach ($form['#entity_builders'] as $function) {
call_user_func_array($form_state->prepareCallback($function), [
$entity->getEntityTypeId(),
$entity,
&$form,
&$form_state,
]);
}
}
return $entity;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.