You are here

public function FormModeManager::setEntityHandlersPerFormModes in Form mode manager 8

Same name and namespace in other branches
  1. 8.2 src/FormModeManager.php \Drupal\form_mode_manager\FormModeManager::setEntityHandlersPerFormModes()

Set all entity handlers needed by form mode manager on entity type basis.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_definition: The entity type to alter.

Overrides FormModeManagerInterface::setEntityHandlersPerFormModes

File

src/FormModeManager.php, line 292

Class

FormModeManager
FormDisplayManager service.

Namespace

Drupal\form_mode_manager

Code

public function setEntityHandlersPerFormModes(EntityTypeInterface $entity_definition) {
  $form_modes = $this
    ->getFormModesIdByEntity($entity_definition
    ->id());
  if (empty($form_modes)) {
    return;
  }
  foreach ($form_modes as $form_mode_name) {
    $this
      ->setFormClassPerFormModes($entity_definition, $form_mode_name);
    $this
      ->setLinkTemplatePerFormModes($entity_definition, $form_mode_name);
  }
}