Invokes a node hook.
\Drupal\Core\Entity\EntityInterface $node: A Node entity.
$hook: A string containing the name of the hook.
$a2, $a3, $a4: (optional) Arguments to pass on to the hook, after the $node argument. All default to NULL.
The returned value of the invoked hook.
function node_invoke(EntityInterface $node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
if ($function = node_hook($node->type, $hook)) {
return $function($node, $a2, $a3, $a4);
}
}