public static function NodeCommentBlock::getNode in Node Comment Block 7.2
Get the node ID from a path.
Parameters
string $path: The path.
Return value
\stdClass|null The node or NULL.
1 call to NodeCommentBlock::getNode()
- node_comment_block_block_view in ./
node_comment_block.module - Implements hook_block_view().
File
- includes/
node_comment_block.controller.inc, line 22 - A controller class for Node Comment Block.
Class
- NodeCommentBlock
- Class NodeCommentBlock
Code
public static function getNode($path) {
preg_match('/node\\/(\\d+)\\/?$/', $path, $matches);
return isset($matches[1]) ? node_load($matches[1]) : NULL;
}