You are here

function _nodehierarchy_get_parent_next_child_weight in Node Hierarchy 7.4

Get the next child weight for a given pnid.

1 call to _nodehierarchy_get_parent_next_child_weight()
_nodehierarchy_record_save in ./nodehierarchy.admin.inc
Save a nodehierarchy record, resetting weights if applicable

File

./nodehierarchy.admin.inc, line 877
Admin functions for Node Hierarchy

Code

function _nodehierarchy_get_parent_next_child_weight($pnid) {
  $out = db_query('SELECT MAX(cweight) FROM {nodehierarchy} WHERE pnid = :pnid', array(
    ':pnid' => $pnid,
  ))
    ->fetchField();
  if ($out !== NULL) {
    return $out + 1;
  }
  return 0;
}