Implements \Drupal\Core\Entity\EntityFormControllerInterface::submit().
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be passed to the following submit handlers. At this point of the form workflow the entity is validated and the form state can be updated, this way the subsequently invoked handlers can retrieve a regular entity object to act on.
array $form: An associative array containing the structure of the form.
array $form_state: A reference to a keyed array containing the current state of the form.
Overrides EntityFormControllerInterface::submit
public function submit(array $form, array &$form_state) {
// Remove button and internal Form API values from submitted values.
form_state_values_clean($form_state);
$this
->updateFormLangcode($form_state);
$this
->submitEntityLanguage($form, $form_state);
$this->entity = $this
->buildEntity($form, $form_state);
return $this->entity;
}