FieldStorageDefinitionListenerInterface.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Drupal\Core\Field;
  3. /**
  4. * Defines an interface for reacting to field storage definition creation, deletion, and updates.
  5. */
  6. interface FieldStorageDefinitionListenerInterface {
  7. /**
  8. * Reacts to the creation of a field storage definition.
  9. *
  10. * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
  11. * The definition being created.
  12. */
  13. public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition);
  14. /**
  15. * Reacts to the update of a field storage definition.
  16. *
  17. * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
  18. * The field being updated.
  19. * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $original
  20. * The original storage definition; i.e., the definition before the update.
  21. *
  22. * @throws \Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException
  23. * Thrown when the update to the field is forbidden.
  24. */
  25. public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original);
  26. /**
  27. * Reacts to the deletion of a field storage definition.
  28. *
  29. * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition
  30. * The field being deleted.
  31. */
  32. public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition);
  33. }