function FieldTestHooks::entityReferenceSelectionAlter

Same name and namespace in other branches
  1. 11.x core/modules/field/tests/modules/field_test/src/Hook/FieldTestHooks.php \Drupal\field_test\Hook\FieldTestHooks::entityReferenceSelectionAlter()

Implements hook_entity_reference_selection_alter().

Attributes

#[Hook('entity_reference_selection_alter')]

File

core/modules/field/tests/modules/field_test/src/Hook/FieldTestHooks.php, line 201

Class

FieldTestHooks
Hook implementations for field_test.

Namespace

Drupal\field_test\Hook

Code

public function entityReferenceSelectionAlter(array &$definitions) : void {
  if (\Drupal::state()->get('field_test_disable_broken_entity_reference_handler')) {
    unset($definitions['broken']);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.