FieldStorageConfig::getSetting

public FieldStorageConfig::getSetting($setting_name)

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 550

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;
  }
}
doc_Drupal
2016-10-29 09:12:20
Comments
Leave a Comment

Please login to continue.