function SettingTrait::set_value in Fasttoggle 8.2
Modify the setting.
Parameters
string instance: The instance to modify.
mixed newValue: The new value to save
Return value
\Drupal\fasttoggle\Plugin\SettingObject\SettingObjectInterface The related object, so you can chain a call to its the save method.
2 calls to SettingTrait::set_value()
- SettingTrait::nextValue in src/
Plugin/ Setting/ SettingTrait.php - Move to the next setting value.
- SettingTrait::previousValue in src/
Plugin/ Setting/ SettingTrait.php - Move to the previous setting value and save it.
1 method overrides SettingTrait::set_value()
- NodeStatus::set_value in src/
Plugin/ Setting/ NodeStatus.php - Retrieve the current value of the setting.
File
- src/
Plugin/ Setting/ SettingTrait.php, line 153 - Fasttoggle Object List of Values Setting
Class
- SettingTrait
- Abstract interface for settings.
Namespace
Drupal\fasttoggle\Plugin\SettingCode
function set_value($instance, $newValue) {
if (is_array($this->object)) {
$ref =& $this->object[$this->name];
}
else {
$ref =& $this->object->{$this->name};
}
// $ref = $ref->get($instance == '' ? 0 : $instance)->value;
$ref
->setValue($newValue);
}