BookManager::updateParent

protected BookManager::updateParent(array $link)

Sets the has_children flag of the parent of the node.

This method is mostly called when a book link is moved/created etc. So we want to update the has_children flag of the new parent book link.

Parameters

array $link: The book link, data reflecting its new position, whose new parent we want to update.

Return value

bool TRUE if the update was successful (either there is no parent to update, or the parent was updated successfully), FALSE on failure.

File

core/modules/book/src/BookManager.php, line 866

Class

BookManager
Defines a book manager.

Namespace

Drupal\book

Code

protected function updateParent(array $link) {
  if ($link['pid'] == 0) {
    // Nothing to update.
    return TRUE;
  }
  return $this->bookOutlineStorage->update($link['pid'], array('has_children' => 1));
}
doc_Drupal
2016-10-29 08:48:13
Comments
Leave a Comment

Please login to continue.