You are here

interface TocManagerInterface in TOC API 8

Provides an interface defining a TOC manager.

Hierarchy

Expanded class hierarchy of TocManagerInterface

All classes that implement TocManagerInterface

File

src/TocManagerInterface.php, line 8

Namespace

Drupal\toc_api
View source
interface TocManagerInterface {

  /**
   * Constructs a new TOC object.
   *
   * @param string $id
   *   ID used to track the TOC object's instance. Typically, the ID can be
   *   the TOC implementation's module name.
   * @param string $source
   *   The HTML content that contains header tags used to create a table of
   *   contents.
   * @param array $options
   *   (optional) An associative array of options used to generate a table of
   *   contents and bookmarked headers.
   *
   * @return \Drupal\toc_api\TocInterface
   *   A new TOC object.
   */
  public function create($id, $source, array $options = []);

  /**
   * Get the current TOC instance.
   *
   * @param string $id
   *   ID used to track the TOC object's instance. Typically, the ID can be
   *   the TOC implementation's module name.
   *
   * @return \Drupal\toc_api\TocInterface
   *   The current TOC instance.
   */
  public function getToc($id);

  /**
   * Reset the current TOC instance.
   *
   * @param string $id
   *   ID used to track the TOC object's instance. Typically, the ID can be
   *   the TOC implementation's module name.
   */
  public function reset($id = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
TocManagerInterface::create public function Constructs a new TOC object. 1
TocManagerInterface::getToc public function Get the current TOC instance. 1
TocManagerInterface::reset public function Reset the current TOC instance. 1