3 namespace Drupal\field;
5 use Drupal\Core\Config\Entity\ConfigEntityInterface;
6 use Drupal\Core\Field\FieldStorageDefinitionInterface;
9 * Provides an interface defining a field storage entity.
11 interface FieldStorageConfigInterface extends ConfigEntityInterface, FieldStorageDefinitionInterface {
14 * Returns the field type.
17 * The field type, i.e. the id of a field type plugin. For example 'text'.
19 public function getType();
22 * Returns the name of the module providing the field type.
25 * The name of the module that provides the field type.
27 public function getTypeProvider();
30 * Returns the list of bundles where the field storage has fields.
33 * An array of bundle names.
35 public function getBundles();
38 * Checks if the field storage can be deleted.
41 * TRUE if the field storage can be deleted.
43 public function isDeletable();
46 * Returns whether the field storage is locked or not.
49 * TRUE if the field storage is locked.
51 public function isLocked();
54 * Sets the locked flag.
57 * Sets value of locked flag.
61 public function setLocked($locked);
64 * Sets the maximum number of items allowed for the field.
66 * @param int $cardinality
67 * The cardinality value.
71 public function setCardinality($cardinality);
74 * Sets the value for a field setting by name.
76 * @param string $setting_name
77 * The name of the setting.
79 * The value of the setting.
83 public function setSetting($setting_name, $value);
86 * Sets field storage settings.
88 * Note that the method does not unset existing settings not specified in the
89 * incoming $settings array.
93 * // Given these are the default settings.
94 * $storage_definition->getSettings() === [
96 * 'season' => 'summer',
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',
107 * For clarity, it is preferred to use setSetting() if not all available
108 * settings are supplied.
110 * @param array $settings
111 * The array of storage settings.
115 public function setSettings(array $settings);
118 * Sets whether the field is translatable.
120 * @param bool $translatable
121 * Whether the field is translatable.
125 public function setTranslatable($translatable);
128 * Returns the custom storage indexes for the field data storage.
131 * An array of custom indexes.
133 public function getIndexes();
136 * Sets the custom storage indexes for the field data storage..
138 * @param array $indexes
139 * The array of custom indexes.
143 public function setIndexes(array $indexes);