You are here

public function PluginSettingsBase::setSetting in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/PluginSettingsBase.php \Drupal\Core\Field\PluginSettingsBase::setSetting()
  2. 10 core/lib/Drupal/Core/Field/PluginSettingsBase.php \Drupal\Core\Field\PluginSettingsBase::setSetting()

Sets the value of a setting for the plugin.

Parameters

string $key: The setting name.

mixed $value: The setting value.

Return value

$this

Overrides PluginSettingsInterface::setSetting

3 calls to PluginSettingsBase::setSetting()
ImageFormatter::onDependencyRemoval in core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
Informs the plugin that some configuration it depends on will be deleted.
ImageWidget::onDependencyRemoval in core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
Informs the plugin that some configuration it depends on will be deleted.
TestFieldWidget::onDependencyRemoval in core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidget.php
Informs the plugin that some configuration it depends on will be deleted.

File

core/lib/Drupal/Core/Field/PluginSettingsBase.php, line 87

Class

PluginSettingsBase
Base class for the Field API plugins.

Namespace

Drupal\Core\Field

Code

public function setSetting($key, $value) {
  $this->settings[$key] = $value;
  return $this;
}