You are here

function nodehierarchy_get_node_children_count in Node Hierarchy 7.4

Count the children of the given node.

1 call to nodehierarchy_get_node_children_count()
nodehierarchy_alter_node_delete_confirm_form in ./nodehierarchy.admin.inc
Add Node Hierarchy delete options to the node delete confirm form.

File

./nodehierarchy.api.inc, line 126
API functions for Node Hierarchy

Code

function nodehierarchy_get_node_children_count($node) {
  $pnid = $node;
  if (is_object($node)) {
    $pnid = $node->nid;
  }
  return (int) db_query("SELECT count(*) FROM {nodehierarchy} WHERE pnid = :pnid", array(
    ':pnid' => $pnid,
  ))
    ->fetchField();
}