You are here

function entity_schema_test_entity_bundle_field_info in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module \entity_schema_test_entity_bundle_field_info()

Implements hook_entity_bundle_field_info().

2 calls to entity_schema_test_entity_bundle_field_info()
entity_schema_test_entity_bundle_create in core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module
Implements hook_entity_bundle_create().
entity_schema_test_entity_bundle_delete in core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module
Implements hook_entity_bundle_delete().

File

core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module, line 63
Test module for the entity API providing a bundle field.

Code

function entity_schema_test_entity_bundle_field_info(EntityTypeInterface $entity_type, $bundle) {
  if ($entity_type
    ->id() == 'entity_test' && $bundle == 'custom') {
    $definitions['custom_bundle_field'] = \Drupal::entityManager()
      ->getFieldStorageDefinitions($entity_type
      ->id())['custom_bundle_field'];
    return $definitions;
  }
}