You are here

public static function TestItem::storageSettingsFromConfigData in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php \Drupal\field_test\Plugin\Field\FieldType\TestItem::storageSettingsFromConfigData()

Returns a settings array in the field type's canonical representation.

This function does the inverse of static::storageSettingsToConfigData(). It's called when loading a field's settings from a configuration object.

Parameters

array $settings: The field's settings, as it is stored within a configuration object.

Return value

array The settings, in the representation expected by the field type and code that interacts with it.

Overrides FieldItemBase::storageSettingsFromConfigData

See also

\Drupal\Core\Field\FieldItemInterface::storageSettingsToConfigData()

File

core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php, line 149

Class

TestItem
Defines the 'test_field' entity field item.

Namespace

Drupal\field_test\Plugin\Field\FieldType

Code

public static function storageSettingsFromConfigData(array $settings) {
  $settings['storage_setting_from_config_data'] = 'TRUE';
  unset($settings['config_data_from_storage_setting']);
  return $settings;
}