function DisplayPluginBase::destroy

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::destroy()
  2. 8.9.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::destroy()
  3. 11.x core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::destroy()

Overrides PluginBase::destroy

File

core/modules/views/src/Plugin/views/display/DisplayPluginBase.php, line 223

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function destroy() {
    parent::destroy();
    foreach ($this->handlers as $type => $handlers) {
        foreach ($handlers as $id => $handler) {
            if (is_object($handler)) {
                $this->handlers[$type][$id]
                    ->destroy();
            }
        }
    }
    if (isset($this->default_display)) {
        unset($this->default_display);
    }
    foreach ($this->extenders as $extender) {
        $extender->destroy();
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.