BundleFieldDefinition.php 726 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Drupal\entity;
  3. use Drupal\Core\Field\BaseFieldDefinition;
  4. /**
  5. * Provides a field definition class for bundle fields.
  6. *
  7. * Core currently doesn't provide one, the hook_entity_bundle_field_info()
  8. * example uses BaseFieldDefinition, which is wrong. Tracked in #2346347.
  9. *
  10. * Note that this class implements both FieldStorageDefinitionInterface and
  11. * FieldDefinitionInterface. This is a simplification for DX reasons,
  12. * allowing code to return just the bundle definitions instead of having to
  13. * return both storage definitions and bundle definitions.
  14. */
  15. class BundleFieldDefinition extends BaseFieldDefinition {
  16. /**
  17. * {@inheritdoc}
  18. */
  19. public function isBaseField() {
  20. return FALSE;
  21. }
  22. }