You are here

public function FieldStorageConfig::getSetting in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getSetting()

Returns the value of a given storage setting.

Parameters

string $setting_name: The setting name.

Return value

mixed The setting value.

Overrides FieldStorageDefinitionInterface::getSetting

File

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

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

public function getSetting($setting_name) {

  // @todo See getSettings() about potentially statically caching this.
  // We assume here that one call to array_key_exists() is more efficient
  // than calling getSettings() when all we need is a single setting.
  if (array_key_exists($setting_name, $this->settings)) {
    return $this->settings[$setting_name];
  }
  $settings = $this
    ->getSettings();
  if (array_key_exists($setting_name, $settings)) {
    return $settings[$setting_name];
  }
  else {
    return NULL;
  }
}