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 * Returns whether the field is deleted or not.
41 * TRUE if the field is deleted.
43 public function isDeleted();
46 * Checks if the field storage can be deleted.
49 * TRUE if the field storage can be deleted.
51 public function isDeletable();
54 * Returns whether the field storage is locked or not.
57 * TRUE if the field storage is locked.
59 public function isLocked();
62 * Sets the locked flag.
65 * Sets value of locked flag.
69 public function setLocked($locked);
72 * Sets the maximum number of items allowed for the field.
74 * @param int $cardinality
75 * The cardinality value.
79 public function setCardinality($cardinality);
82 * Sets the value for a field setting by name.
84 * @param string $setting_name
85 * The name of the setting.
87 * The value of the setting.
91 public function setSetting($setting_name, $value);
94 * Sets field storage settings.
96 * Note that the method does not unset existing settings not specified in the
97 * incoming $settings array.
101 * // Given these are the default settings.
102 * $storage_definition->getSettings() === [
103 * 'fruit' => 'apple',
104 * 'season' => 'summer',
106 * // Change only the 'fruit' setting.
107 * $storage_definition->setSettings(['fruit' => 'banana']);
108 * // The 'season' setting persists unchanged.
109 * $storage_definition->getSettings() === [
110 * 'fruit' => 'banana',
111 * 'season' => 'summer',
115 * For clarity, it is preferred to use setSetting() if not all available
116 * settings are supplied.
118 * @param array $settings
119 * The array of storage settings.
123 public function setSettings(array $settings);
126 * Sets whether the field is translatable.
128 * @param bool $translatable
129 * Whether the field is translatable.
133 public function setTranslatable($translatable);
136 * Returns the custom storage indexes for the field data storage.
139 * An array of custom indexes.
141 public function getIndexes();
144 * Sets the custom storage indexes for the field data storage..
146 * @param array $indexes
147 * The array of custom indexes.
151 public function setIndexes(array $indexes);