protected function EntityFormController::init

Initialize the form state and the entity before the first form build.

1 call to EntityFormController::init()

File

drupal/core/lib/Drupal/Core/Entity/EntityFormController.php, line 63
Definition of Drupal\Core\Entity\EntityFormController.

Class

EntityFormController
Base class for entity form controllers.

Namespace

Drupal\Core\Entity

Code

protected function init(array &$form_state, EntityInterface $entity) {

  // Add the controller to the form state so it can be easily accessed by
  // module-provided form handlers there.
  $form_state['controller'] = $this;
  $this
    ->setEntity($entity, $form_state);
  $this
    ->prepareEntity($entity);
}