function FieldStorageConfig::getSettings
Same name and namespace in other branches
- 9 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getSettings()
- 8.9.x core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getSettings()
- 11.x core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getSettings()
Returns the storage settings.
Each field type defines the settings that are meaningful for that type. For example, a text field can define a 'max_length' setting, and an image field can define an 'alt_field_required' setting.
The method always returns an array of all available settings for this field type, possibly with the default values merged in if values have not been provided for all available settings.
Return value
mixed[] An array of key/value pairs.
Overrides FieldStorageDefinitionInterface::getSettings
2 calls to FieldStorageConfig::getSettings()
- FieldStorageConfig::getSetting in core/
modules/ field/ src/ Entity/ FieldStorageConfig.php - Returns the value of a given storage setting.
- FieldStorageConfig::postCreate in core/
modules/ field/ src/ Entity/ FieldStorageConfig.php - Acts on a created entity before hooks are invoked.
File
-
core/
modules/ field/ src/ Entity/ FieldStorageConfig.php, line 565
Class
- FieldStorageConfig
- Defines the Field storage configuration entity.
Namespace
Drupal\field\EntityCode
public function getSettings() {
// @todo FieldTypePluginManager maintains its own static cache. However, do
// some CPU and memory profiling to see if it's worth statically caching
// $field_type_info, or the default field storage and field settings,
// within $this.
$field_type_manager = \Drupal::service('plugin.manager.field.field_type');
$settings = $field_type_manager->getDefaultStorageSettings($this->getType());
return $this->settings + $settings;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.