function DisplayPluginCollection::clear

Same name in other branches
  1. 8.9.x core/modules/views/src/DisplayPluginCollection.php \Drupal\views\DisplayPluginCollection::clear()
  2. 10 core/modules/views/src/DisplayPluginCollection.php \Drupal\views\DisplayPluginCollection::clear()
  3. 11.x core/modules/views/src/DisplayPluginCollection.php \Drupal\views\DisplayPluginCollection::clear()

Overrides LazyPluginCollection::clear

1 call to DisplayPluginCollection::clear()
DisplayPluginCollection::__destruct in core/modules/views/src/DisplayPluginCollection.php
Destructs a DisplayPluginCollection object.

File

core/modules/views/src/DisplayPluginCollection.php, line 60

Class

DisplayPluginCollection
A class which wraps the displays of a view so you can lazy-initialize them.

Namespace

Drupal\views

Code

public function clear() {
    foreach (array_filter($this->pluginInstances) as $display) {
        $display->destroy();
    }
    parent::clear();
}

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