function BookManager::saveBookLink

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

Saves a link for a single book entry to the book.

Parameters

array $link: The link data to save. $link['nid'] must be set. Other keys in this array get default values from \Drupal\book\BookManagerInterface::getLinkDefaults(). The array keys available to be set are documented in \Drupal\book\BookOutlineStorageInterface::loadMultiple().

bool $new: Whether this is a link to a new book entry.

Return value

array The book entry link information. This is $link with values added or updated.

Overrides BookManagerInterface::saveBookLink

File

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

Class

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

Namespace

Drupal\book\ProxyClass

Code

public function saveBookLink(array $link, $new) {
  return $this->lazyLoadItself()
    ->saveBookLink($link, $new);
}

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