You are here

public function FieldConfigBase::getSetting in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/FieldConfigBase.php \Drupal\Core\Field\FieldConfigBase::getSetting()

Returns the value of a given setting.

Parameters

string $setting_name: The setting name.

Return value

mixed The setting value.

Overrides DataDefinitionInterface::getSetting

File

core/lib/Drupal/Core/Field/FieldConfigBase.php, line 360

Class

FieldConfigBase
Base class for configurable field definitions.

Namespace

Drupal\Core\Field

Code

public function getSetting($setting_name) {
  if (array_key_exists($setting_name, $this->settings)) {
    return $this->settings[$setting_name];
  }
  else {
    return $this
      ->getFieldStorageDefinition()
      ->getSetting($setting_name);
  }
}