You are here

function taxonomy_term_display_configurable_test_entity_base_field_info_alter in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/taxonomy/tests/modules/taxonomy_term_display_configurable_test/taxonomy_term_display_configurable_test.module \taxonomy_term_display_configurable_test_entity_base_field_info_alter()
  2. 10 core/modules/taxonomy/tests/modules/taxonomy_term_display_configurable_test/taxonomy_term_display_configurable_test.module \taxonomy_term_display_configurable_test_entity_base_field_info_alter()

Implements hook_entity_base_field_info_alter().

File

core/modules/taxonomy/tests/modules/taxonomy_term_display_configurable_test/taxonomy_term_display_configurable_test.module, line 14
A module for testing making taxonomy_term base fields' displays configurable.

Code

function taxonomy_term_display_configurable_test_entity_base_field_info_alter(&$base_field_definitions, EntityTypeInterface $entity_type) {
  if ($entity_type
    ->id() === 'taxonomy_term') {

    /** @var \Drupal\Core\Field\BaseFieldDefinition[] $base_field_definitions */
    $base_field_definitions['name']
      ->setDisplayConfigurable('view', TRUE);
  }
}