DeletedFieldsRepositoryInterface.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace Drupal\Core\Field;
  3. /**
  4. * Provides an interface for a deleted fields repository.
  5. *
  6. * @internal
  7. */
  8. interface DeletedFieldsRepositoryInterface {
  9. /**
  10. * Returns a list of deleted field definitions.
  11. *
  12. * @param string $field_storage_unique_id
  13. * (optional) A unique ID of field storage definition for filtering the
  14. * deleted fields. Defaults to NULL.
  15. *
  16. * @return \Drupal\Core\Field\FieldDefinitionInterface[]
  17. * An array of field definition objects, keyed by their unique identifier.
  18. */
  19. public function getFieldDefinitions($field_storage_unique_id = NULL);
  20. /**
  21. * Returns a list of deleted field storage definitions.
  22. *
  23. * @return \Drupal\Core\Field\FieldStorageDefinitionInterface[]
  24. * An array of field storage definition objects, keyed by their unique
  25. * storage identifier.
  26. */
  27. public function getFieldStorageDefinitions();
  28. /**
  29. * Adds a field definition object to the deleted list.
  30. *
  31. * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  32. * A field definition object.
  33. *
  34. * @return $this
  35. */
  36. public function addFieldDefinition(FieldDefinitionInterface $field_definition);
  37. /**
  38. * Adds a field storage definition object to the deleted list.
  39. *
  40. * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $field_storage_definition
  41. * A field storage definition object.
  42. *
  43. * @return $this
  44. */
  45. public function addFieldStorageDefinition(FieldStorageDefinitionInterface $field_storage_definition);
  46. /**
  47. * Removes a field definition object from the deleted list.
  48. *
  49. * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  50. * A field definition object.
  51. *
  52. * @return $this
  53. */
  54. public function removeFieldDefinition(FieldDefinitionInterface $field_definition);
  55. /**
  56. * Removes a field storage definition object from the deleted list.
  57. *
  58. * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $field_storage_definition
  59. * A field storage definition object.
  60. *
  61. * @return $this
  62. */
  63. public function removeFieldStorageDefinition(FieldStorageDefinitionInterface $field_storage_definition);
  64. }