public function PageEventVariables::getNode in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 modules/preprocess_event_dispatcher/src/Variables/PageEventVariables.php \Drupal\preprocess_event_dispatcher\Variables\PageEventVariables::getNode()
Get the node of the page.
Return value
\Drupal\node\NodeInterface|null Drupal node.
File
- modules/
preprocess_event_dispatcher/ src/ Variables/ PageEventVariables.php, line 28
Class
- PageEventVariables
- Class PageEventVariables.
Namespace
Drupal\preprocess_event_dispatcher\VariablesCode
public function getNode() : ?NodeInterface {
if (!$this
->isNodePage()) {
return NULL;
}
return $this->variables['node'];
}