class BookManager

Same name in this branch
  1. 11.x 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. 10 core/modules/book/src/ProxyClass/BookManager.php \Drupal\book\ProxyClass\BookManager
  4. 10 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 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
BookManager::bookLinkTranslate public function
BookManager::bookSubtreeData public function
BookManager::bookTreeAllData public function
BookManager::bookTreeCheckAccess public function
BookManager::bookTreeCollectNodeLinks public function
BookManager::bookTreeGetFlat public function
BookManager::bookTreeOutput public function
BookManager::checkNodeIsRemovable public function
BookManager::deleteFromBook public function
BookManager::getActiveTrailIds public function
BookManager::getAllBooks public function
BookManager::getBookParents public function
BookManager::getLinkDefaults public function
BookManager::getParentDepthLimit public function
BookManager::getTableOfContents public function
BookManager::lazyLoadItself protected function Lazy loads the real service from the container.
BookManager::loadBookLink public function
BookManager::loadBookLinks public function
BookManager::saveBookLink public function
BookManager::setStringTranslation public function
BookManager::updateOutline public function
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.