More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / modules / field / src / FieldStorageConfigInterface.php
1 <?php
2
3 namespace Drupal\field;
4
5 use Drupal\Core\Config\Entity\ConfigEntityInterface;
6 use Drupal\Core\Field\FieldStorageDefinitionInterface;
7
8 /**
9  * Provides an interface defining a field storage entity.
10  */
11 interface FieldStorageConfigInterface extends ConfigEntityInterface, FieldStorageDefinitionInterface {
12
13   /**
14    * Returns the field type.
15    *
16    * @return string
17    *   The field type, i.e. the id of a field type plugin. For example 'text'.
18    */
19   public function getType();
20
21   /**
22    * Returns the name of the module providing the field type.
23    *
24    * @return string
25    *   The name of the module that provides the field type.
26    */
27   public function getTypeProvider();
28
29   /**
30    * Returns the list of bundles where the field storage has fields.
31    *
32    * @return array
33    *   An array of bundle names.
34    */
35   public function getBundles();
36
37   /**
38    * Checks if the field storage can be deleted.
39    *
40    * @return bool
41    *   TRUE if the field storage can be deleted.
42    */
43   public function isDeletable();
44
45   /**
46    * Returns whether the field storage is locked or not.
47    *
48    * @return bool
49    *   TRUE if the field storage is locked.
50    */
51   public function isLocked();
52
53   /**
54    * Sets the locked flag.
55    *
56    * @param bool $locked
57    *   Sets value of locked flag.
58    *
59    * @return $this
60    */
61   public function setLocked($locked);
62
63   /**
64    * Sets the maximum number of items allowed for the field.
65    *
66    * @param int $cardinality
67    *   The cardinality value.
68    *
69    * @return $this
70    */
71   public function setCardinality($cardinality);
72
73   /**
74    * Sets the value for a field setting by name.
75    *
76    * @param string $setting_name
77    *   The name of the setting.
78    * @param mixed $value
79    *   The value of the setting.
80    *
81    * @return $this
82    */
83   public function setSetting($setting_name, $value);
84
85   /**
86    * Sets field storage settings.
87    *
88    * Note that the method does not unset existing settings not specified in the
89    * incoming $settings array.
90    *
91    * For example:
92    * @code
93    *   // Given these are the default settings.
94    *   $storage_definition->getSettings() === [
95    *     'fruit' => 'apple',
96    *     'season' => 'summer',
97    *   ];
98    *   // Change only the 'fruit' setting.
99    *   $storage_definition->setSettings(['fruit' => 'banana']);
100    *   // The 'season' setting persists unchanged.
101    *   $storage_definition->getSettings() === [
102    *     'fruit' => 'banana',
103    *     'season' => 'summer',
104    *   ];
105    * @endcode
106    *
107    * For clarity, it is preferred to use setSetting() if not all available
108    * settings are supplied.
109    *
110    * @param array $settings
111    *   The array of storage settings.
112    *
113    * @return $this
114    */
115   public function setSettings(array $settings);
116
117   /**
118    * Sets whether the field is translatable.
119    *
120    * @param bool $translatable
121    *   Whether the field is translatable.
122    *
123    * @return $this
124    */
125   public function setTranslatable($translatable);
126
127   /**
128    * Returns the custom storage indexes for the field data storage.
129    *
130    * @return array
131    *   An array of custom indexes.
132    */
133   public function getIndexes();
134
135   /**
136    * Sets the custom storage indexes for the field data storage..
137    *
138    * @param array $indexes
139    *   The array of custom indexes.
140    *
141    * @return $this
142    */
143   public function setIndexes(array $indexes);
144
145 }