You are here

public function TocManager::reset in TOC API 8

Reset the current TOC instance.

Parameters

string $id: ID used to track the TOC object's instance. Typically, the ID can be the TOC implementation's module name.

Overrides TocManagerInterface::reset

File

src/TocManager.php, line 63

Class

TocManager
Defines a service that creates and manages table of contents instances.

Namespace

Drupal\toc_api

Code

public function reset($id = NULL) {
  if ($id === NULL) {
    $this->tocs = [];
  }
  else {
    unset($this->tocs[$id]);
  }
}