hook_entity_prepare_form
function hook_entity_prepare_form
hook_entity_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, $operation, \Drupal\Core\Form\FormStateInterface $form_state)
Acts on an entity object about to be shown on an entity form.
This can be typically used to pre-fill entity values or change the form state before the entity form is built. It is invoked just once when first building the entity form. Rebuilds will not trigger a new invocation.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity that is about to be shown on the form.
$operation: The current operation.