You are here

public function FieldDefinition::getSetting in Drupal 10

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

Returns the value of a given setting.

Parameters

string $setting_name: The setting name.

Return value

mixed The setting value.

Overrides DataDefinition::getSetting

File

core/lib/Drupal/Core/Field/FieldDefinition.php, line 288

Class

FieldDefinition
A class for defining entity field definitions.

Namespace

Drupal\Core\Field

Code

public function getSetting($setting_name) {
  if (array_key_exists($setting_name, $this->itemDefinition
    ->getSettings())) {
    return $this->itemDefinition
      ->getSetting($setting_name);
  }
  else {
    return $this
      ->getFieldStorageDefinition()
      ->getSetting($setting_name);
  }
}