function TopLevelBook::getArgument
Same name in other branches
- 9 core/modules/book/src/Plugin/views/argument_default/TopLevelBook.php \Drupal\book\Plugin\views\argument_default\TopLevelBook::getArgument()
- 8.9.x core/modules/book/src/Plugin/views/argument_default/TopLevelBook.php \Drupal\book\Plugin\views\argument_default\TopLevelBook::getArgument()
- 11.x core/modules/book/src/Plugin/views/argument_default/TopLevelBook.php \Drupal\book\Plugin\views\argument_default\TopLevelBook::getArgument()
Overrides Node::getArgument
File
-
core/
modules/ book/ src/ Plugin/ views/ argument_default/ TopLevelBook.php, line 63
Class
- TopLevelBook
- Default argument plugin to get the current node's top level book.
Namespace
Drupal\book\Plugin\views\argument_defaultCode
public function getArgument() {
// Use the argument_default_node plugin to get the nid argument.
$nid = parent::getArgument();
if (!empty($nid)) {
$node = $this->nodeStorage
->load($nid);
if (isset($node->book['bid'])) {
return $node->book['bid'];
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.