function book_node_predelete

Same name in other branches
  1. 9 core/modules/book/book.module \book_node_predelete()
  2. 10 core/modules/book/book.module \book_node_predelete()
  3. 11.x core/modules/book/book.module \book_node_predelete()

Implements hook_ENTITY_TYPE_predelete() for node entities.

File

core/modules/book/book.module, line 281

Code

function book_node_predelete(EntityInterface $node) {
    if (!empty($node->book['bid'])) {
        
        /** @var \Drupal\book\BookManagerInterface $book_manager */
        $book_manager = \Drupal::service('book.manager');
        $book_manager->deleteFromBook($node->book['nid']);
    }
}

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