public BookManager::deleteFromBook($nid)
Deletes node's entry from book table.
Parameters
int $nid: The nid to delete.
Overrides BookManagerInterface::deleteFromBook
File
- core/modules/book/src/BookManager.php, line 431
Class
- BookManager
- Defines a book manager.
Namespace
Drupal\book
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | public function deleteFromBook( $nid ) { $original = $this ->loadBookLink( $nid , FALSE); $this ->bookOutlineStorage-> delete ( $nid ); if ( $nid == $original [ 'bid' ]) { // Handle deletion of a top-level post. $result = $this ->bookOutlineStorage->loadBookChildren( $nid ); $children = $this ->entityManager->getStorage( 'node' )->loadMultiple( array_keys ( $result )); foreach ( $children as $child ) { $child ->book[ 'bid' ] = $child ->id(); $this ->updateOutline( $child ); } } $this ->updateOriginalParent( $original ); $this ->books = NULL; Cache::invalidateTags( array ( 'bid:' . $original [ 'bid' ])); } |
Please login to continue.