Implements Drupal\Core\Entity\EntityFormControllerInterface::build().
Overrides EntityFormControllerInterface::build
public function build(array $form, array &$form_state, EntityInterface $entity) {
// During the initial form build, add the entity to the form state for use
// during form building and processing. During a rebuild, use what is in the
// form state.
if (!$this
->getEntity($form_state)) {
$this
->init($form_state, $entity);
}
// Retrieve the form array using the possibly updated entity in form state.
$entity = $this
->getEntity($form_state);
$form = $this
->form($form, $form_state, $entity);
// Retrieve and add the form actions array.
$actions = $this
->actionsElement($form, $form_state);
if (!empty($actions)) {
$form['actions'] = $actions;
}
return $form;
}