function EntityForm::processForm

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

Process callback: assigns weights and hides extra fields.

See also

\Drupal\Core\Entity\EntityForm::form()

File

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

Class

EntityForm
Base class for entity forms.

Namespace

Drupal\Core\Entity

Code

public function processForm($element, FormStateInterface $form_state, $form) {
    // If the form is cached, process callbacks may not have a valid reference
    // to the entity object, hence we must restore it.
    $this->entity = $form_state->getFormObject()
        ->getEntity();
    return $element;
}

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