class BookManager

Same name in this branch
  1. 10 core/modules/book/src/BookManager.php \Drupal\book\BookManager
Same name and namespace in other branches
  1. 9 core/modules/book/src/BookManager.php \Drupal\book\BookManager
  2. 8.9.x core/modules/book/src/BookManager.php \Drupal\book\BookManager
  3. 11.x core/modules/book/src/ProxyClass/BookManager.php \Drupal\book\ProxyClass\BookManager
  4. 11.x core/modules/book/src/BookManager.php \Drupal\book\BookManager

Provides a proxy class for \Drupal\book\BookManager.

Hierarchy

Expanded class hierarchy of BookManager

See also

\Drupal\Component\ProxyBuilder

File

core/modules/book/src/ProxyClass/BookManager.php, line 15

Namespace

Drupal\book\ProxyClass
View source
class BookManager implements \Drupal\book\BookManagerInterface {
  use \Drupal\Core\DependencyInjection\DependencySerializationTrait;
  
  /**
   * The id of the original proxied service.
   *
   * @var string
   */
  protected $drupalProxyOriginalServiceId;
  
  /**
   * The real proxied service, after it was lazy loaded.
   *
   * @var \Drupal\book\BookManager
   */
  protected $service;
  
  /**
   * The service container.
   *
   * @var \Symfony\Component\DependencyInjection\ContainerInterface
   */
  protected $container;
  
  /**
   * Constructs a ProxyClass Drupal proxy object.
   *
   * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
   *   The container.
   * @param string $drupal_proxy_original_service_id
   *   The service ID of the original service.
   */
  public function __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container, $drupal_proxy_original_service_id) {
    $this->container = $container;
    $this->drupalProxyOriginalServiceId = $drupal_proxy_original_service_id;
  }
  
  /**
   * Lazy loads the real service from the container.
   *
   * @return object
   *   Returns the constructed real service.
   */
  protected function lazyLoadItself() {
    if (!isset($this->service)) {
      $this->service = $this->container
        ->get($this->drupalProxyOriginalServiceId);
    }
    return $this->service;
  }
  
  /**
   * {@inheritdoc}
   */
  public function getAllBooks() {
    return $this->lazyLoadItself()
      ->getAllBooks();
  }
  
  /**
   * {@inheritdoc}
   */
  public function getLinkDefaults($nid) {
    return $this->lazyLoadItself()
      ->getLinkDefaults($nid);
  }
  
  /**
   * {@inheritdoc}
   */
  public function getParentDepthLimit(array $book_link) {
    return $this->lazyLoadItself()
      ->getParentDepthLimit($book_link);
  }
  
  /**
   * {@inheritdoc}
   */
  public function addFormElements(array $form, \Drupal\Core\Form\FormStateInterface $form_state, \Drupal\node\NodeInterface $node, \Drupal\Core\Session\AccountInterface $account, $collapsed = true) {
    return $this->lazyLoadItself()
      ->addFormElements($form, $form_state, $node, $account, $collapsed);
  }
  
  /**
   * {@inheritdoc}
   */
  public function checkNodeIsRemovable(\Drupal\node\NodeInterface $node) {
    return $this->lazyLoadItself()
      ->checkNodeIsRemovable($node);
  }
  
  /**
   * {@inheritdoc}
   */
  public function updateOutline(\Drupal\node\NodeInterface $node) {
    return $this->lazyLoadItself()
      ->updateOutline($node);
  }
  
  /**
   * {@inheritdoc}
   */
  public function getBookParents(array $item, array $parent = array()) {
    return $this->lazyLoadItself()
      ->getBookParents($item, $parent);
  }
  
  /**
   * {@inheritdoc}
   */
  public function getTableOfContents($bid, $depth_limit, array $exclude = array()) {
    return $this->lazyLoadItself()
      ->getTableOfContents($bid, $depth_limit, $exclude);
  }
  
  /**
   * {@inheritdoc}
   */
  public function deleteFromBook($nid) {
    return $this->lazyLoadItself()
      ->deleteFromBook($nid);
  }
  
  /**
   * {@inheritdoc}
   */
  public function bookTreeAllData($bid, $link = NULL, $max_depth = NULL) {
    return $this->lazyLoadItself()
      ->bookTreeAllData($bid, $link, $max_depth);
  }
  
  /**
   * {@inheritdoc}
   */
  public function getActiveTrailIds($bid, $link) {
    return $this->lazyLoadItself()
      ->getActiveTrailIds($bid, $link);
  }
  
  /**
   * {@inheritdoc}
   */
  public function bookTreeOutput(array $tree) {
    return $this->lazyLoadItself()
      ->bookTreeOutput($tree);
  }
  
  /**
   * {@inheritdoc}
   */
  public function bookTreeCollectNodeLinks(&$tree, &$node_links) {
    return $this->lazyLoadItself()
      ->bookTreeCollectNodeLinks($tree, $node_links);
  }
  
  /**
   * {@inheritdoc}
   */
  public function bookTreeGetFlat(array $book_link) {
    return $this->lazyLoadItself()
      ->bookTreeGetFlat($book_link);
  }
  
  /**
   * {@inheritdoc}
   */
  public function loadBookLink($nid, $translate = true) {
    return $this->lazyLoadItself()
      ->loadBookLink($nid, $translate);
  }
  
  /**
   * {@inheritdoc}
   */
  public function loadBookLinks($nids, $translate = true) {
    return $this->lazyLoadItself()
      ->loadBookLinks($nids, $translate);
  }
  
  /**
   * {@inheritdoc}
   */
  public function saveBookLink(array $link, $new) {
    return $this->lazyLoadItself()
      ->saveBookLink($link, $new);
  }
  
  /**
   * {@inheritdoc}
   */
  public function bookTreeCheckAccess(&$tree, $node_links = array()) {
    return $this->lazyLoadItself()
      ->bookTreeCheckAccess($tree, $node_links);
  }
  
  /**
   * {@inheritdoc}
   */
  public function bookLinkTranslate(&$link) {
    return $this->lazyLoadItself()
      ->bookLinkTranslate($link);
  }
  
  /**
   * {@inheritdoc}
   */
  public function bookSubtreeData($link) {
    return $this->lazyLoadItself()
      ->bookSubtreeData($link);
  }
  
  /**
   * {@inheritdoc}
   */
  public function setStringTranslation(\Drupal\Core\StringTranslation\TranslationInterface $translation) {
    return $this->lazyLoadItself()
      ->setStringTranslation($translation);
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
BookManager::$container protected property The service container.
BookManager::$drupalProxyOriginalServiceId protected property The id of the original proxied service.
BookManager::$service protected property The real proxied service, after it was lazy loaded.
BookManager::addFormElements public function Builds the common elements of the book form for the node and outline forms. Overrides BookManagerInterface::addFormElements
BookManager::bookLinkTranslate public function Provides book loading, access control and translation. Overrides BookManagerInterface::bookLinkTranslate
BookManager::bookSubtreeData public function Gets the data representing a subtree of the book hierarchy. Overrides BookManagerInterface::bookSubtreeData
BookManager::bookTreeAllData public function Gets the data structure representing a named menu tree. Overrides BookManagerInterface::bookTreeAllData
BookManager::bookTreeCheckAccess public function Checks access and performs dynamic operations for each link in the tree. Overrides BookManagerInterface::bookTreeCheckAccess
BookManager::bookTreeCollectNodeLinks public function Collects node links from a given menu tree recursively. Overrides BookManagerInterface::bookTreeCollectNodeLinks
BookManager::bookTreeGetFlat public function Gets the book for a page and returns it as a linear array. Overrides BookManagerInterface::bookTreeGetFlat
BookManager::bookTreeOutput public function Returns a rendered menu tree. Overrides BookManagerInterface::bookTreeOutput
BookManager::checkNodeIsRemovable public function Determines if a node can be removed from the book. Overrides BookManagerInterface::checkNodeIsRemovable
BookManager::deleteFromBook public function Deletes node's entry from book table. Overrides BookManagerInterface::deleteFromBook
BookManager::getActiveTrailIds public function Gets the active trail IDs for the specified book at the provided path. Overrides BookManagerInterface::getActiveTrailIds
BookManager::getAllBooks public function Returns an array of all books. Overrides BookManagerInterface::getAllBooks
BookManager::getBookParents public function Overrides BookManagerInterface::getBookParents
BookManager::getLinkDefaults public function Returns an array with default values for a book page's menu link. Overrides BookManagerInterface::getLinkDefaults
BookManager::getParentDepthLimit public function Finds the depth limit for items in the parent select. Overrides BookManagerInterface::getParentDepthLimit
BookManager::getTableOfContents public function Returns an array of book pages in table of contents order. Overrides BookManagerInterface::getTableOfContents
BookManager::lazyLoadItself protected function Lazy loads the real service from the container.
BookManager::loadBookLink public function Loads a single book entry. Overrides BookManagerInterface::loadBookLink
BookManager::loadBookLinks public function Loads multiple book entries. Overrides BookManagerInterface::loadBookLinks
BookManager::saveBookLink public function Saves a link for a single book entry to the book. Overrides BookManagerInterface::saveBookLink
BookManager::setStringTranslation public function
BookManager::updateOutline public function Handles additions and updates to the book outline. Overrides BookManagerInterface::updateOutline
BookManager::__construct public function Constructs a ProxyClass Drupal proxy object.
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2

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