You are here

public static function EntityReferenceLayoutRevisioned::fieldSettingsFromConfigData in Entity Reference with Layout 8

Manipulate saved data into configuration.

Set 'layout_bundles' configuration item as an array even though it may be stored as a string in case we support attaching layouts to multiple bundles in the future.

Overrides FieldItemBase::fieldSettingsFromConfigData

File

src/Plugin/Field/FieldType/EntityReferenceLayoutRevisioned.php, line 121

Class

EntityReferenceLayoutRevisioned
Entity Reference Layout Revisioned field type.

Namespace

Drupal\entity_reference_layout\Plugin\Field\FieldType

Code

public static function fieldSettingsFromConfigData(array $settings) {
  if (isset($settings['handler_settings']['layout_bundles']) && !is_array($settings['handler_settings']['layout_bundles'])) {
    $settings['handler_settings']['layout_bundles'] = [
      $settings['handler_settings']['layout_bundles'],
    ];
  }
  return $settings;
}