FieldStorageConfig::getSettings

public 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 a '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

File

core/modules/field/src/Entity/FieldStorageConfig.php, line 536

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

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;
}
doc_Drupal
2016-10-29 09:12:20
Comments
Leave a Comment

Please login to continue.