You are here

public function TocManager::getToc in TOC API 8

Get 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.

Return value

\Drupal\toc_api\TocInterface The current TOC instance.

Overrides TocManagerInterface::getToc

File

src/TocManager.php, line 56

Class

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

Namespace

Drupal\toc_api

Code

public function getToc($id) {
  return isset($this->tocs[$id]) ? $this->tocs[$id] : NULL;
}