function DisplayPluginBase::setOverride
Same name in other branches
- 8.9.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::setOverride()
- 10 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::setOverride()
- 11.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::setOverride()
Overrides DisplayPluginInterface::setOverride
2 calls to DisplayPluginBase::setOverride()
- DisplayPluginBase::optionsOverride in core/
modules/ views/ src/ Plugin/ views/ display/ DisplayPluginBase.php - If override/revert was clicked, perform the proper toggle.
- DisplayPluginBase::overrideOption in core/
modules/ views/ src/ Plugin/ views/ display/ DisplayPluginBase.php - Set an option and force it to be an override.
File
-
core/
modules/ views/ src/ Plugin/ views/ display/ DisplayPluginBase.php, line 2052
Class
- DisplayPluginBase
- Base class for views display plugins.
Namespace
Drupal\views\Plugin\views\displayCode
public function setOverride($section, $new_state = NULL) {
$options = $this->defaultableSections($section);
if (!$options) {
return;
}
if (!isset($new_state)) {
$new_state = empty($this->options['defaults'][$section]);
}
// For each option that is part of this group, fix our settings.
foreach ($options as $option) {
if ($new_state) {
// Revert to defaults.
unset($this->options[$option]);
unset($this->display['display_options'][$option]);
}
else {
// Copy existing values into our display.
$this->options[$option] = $this->getOption($option);
$this->display['display_options'][$option] = $this->options[$option];
}
$this->options['defaults'][$option] = $new_state;
$this->display['display_options']['defaults'][$option] = $new_state;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.