You are here

public function EntityTypeInfo::entityTypeAlter in Form mode manager 8

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

Adds Form Mode Manager forms/links to appropriate entity types.

This is an alter hook bridge.

Parameters

\Drupal\Core\Entity\EntityTypeInterface[] $entity_types: The master entity type list to alter.

See also

hook_entity_type_alter()

File

src/EntityTypeInfo.php, line 73

Class

EntityTypeInfo
Manipulates entity type information.

Namespace

Drupal\form_mode_manager

Code

public function entityTypeAlter(array &$entity_types) {
  $available_entity_types = array_keys($this->formModeManager
    ->getAllFormModesDefinitions());
  foreach ($available_entity_types as $entity_type_id) {
    if ($entity_definition = $entity_types[$entity_type_id]) {
      $this->formModeManager
        ->setEntityHandlersPerFormModes($entity_definition);
    }
  }
}