You are here

protected function EntityListTrait::sanitizeListSettings in Formatter Suite 8

Check current settings and insure they make sense.

3 calls to EntityListTrait::sanitizeListSettings()
EntityListTrait::settingsForm in src/Plugin/Field/FieldFormatter/EntityListTrait.php
EntityListTrait::settingsSummary in src/Plugin/Field/FieldFormatter/EntityListTrait.php
EntityListTrait::view in src/Plugin/Field/FieldFormatter/EntityListTrait.php

File

src/Plugin/Field/FieldFormatter/EntityListTrait.php, line 214

Class

EntityListTrait
Formats multiple fields as a list.

Namespace

Drupal\formatter_suite\Plugin\Field\FieldFormatter

Code

protected function sanitizeListSettings() {
  $listStyle = $this
    ->getSetting('listStyle');
  $listStyles = $this
    ->getListStyles();
  $defaults = $this
    ->defaultSettings();
  if (empty($listStyle) === TRUE || isset($listStyles[$listStyle]) === FALSE) {
    $listStyle = $defaults['listStyle'];
    $this
      ->setSetting('listStyle', $listStyle);
  }
}