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