function entity_schema_test_entity_bundle_field_info

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module \entity_schema_test_entity_bundle_field_info()
  2. 8.9.x core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module \entity_schema_test_entity_bundle_field_info()
  3. 10 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().

File

core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module, line 72

Code

function entity_schema_test_entity_bundle_field_info(EntityTypeInterface $entity_type, $bundle) {
    if ($entity_type->id() == 'entity_test_update' && $bundle == 'custom') {
        
        /** @var \Drupal\Core\Field\FieldStorageDefinitionInterface $custom_bundle_field_storage */
        $custom_bundle_field_storage = entity_schema_test_entity_field_storage_info($entity_type)['custom_bundle_field'];
        $definitions[$custom_bundle_field_storage->getName()] = FieldDefinition::createFromFieldStorageDefinition($custom_bundle_field_storage);
        return $definitions;
    }
}

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