Same name and namespace in other branches
  1. 8.9.x core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_entity_extra_field_info()
  2. 9 core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_entity_extra_field_info()

Implements hook_entity_extra_field_info().

File

core/modules/system/tests/modules/entity_test/entity_test.module, line 309
Test module for the entity API providing several entity types for testing.

Code

function entity_test_entity_extra_field_info() {
  $extra['entity_test']['bundle_with_extra_fields'] = [
    'display' => [
      // Note: those extra fields do not currently display anything, they are
      // just used in \Drupal\Tests\field_ui\Kernel\EntityDisplayTest to test
      // the behavior of entity display objects.
      'display_extra_field' => [
        'label' => t('Display extra field'),
        'description' => t('An extra field on the display side.'),
        'weight' => 5,
        'visible' => TRUE,
      ],
      'display_extra_field_hidden' => [
        'label' => t('Display extra field (hidden)'),
        'description' => t('An extra field on the display side, hidden by default.'),
        'visible' => FALSE,
      ],
    ],
  ];
  return $extra;
}