You are here

function _nodehierarchy_get_node_mlids in Node Hierarchy 7.2

Same name and namespace in other branches
  1. 6.3 nodehierarchy.module \_nodehierarchy_get_node_mlids()
  2. 6.2 nodehierarchy.module \_nodehierarchy_get_node_mlids()

Get the menu link id for the given node.

2 calls to _nodehierarchy_get_node_mlids()
nodehierarchy_delete_node_nodehierarchy_menu_links in ./nodehierarchy.module
Delete all link from the node to its menu items.
_nodehierarchy_get_descendant_count in ./nodehierarchy.module
Count the descendants of the given node.

File

./nodehierarchy.module, line 1202
A module to make nodes hierarchical.

Code

function _nodehierarchy_get_node_mlids($nid) {
  $out = array();
  $result = db_query("SELECT mlid FROM {menu_links} WHERE module = :module AND link_path = :link_path ORDER BY mlid", array(
    ':module' => 'nodehierarchy',
    ':link_path' => 'node/' . $nid,
  ), array(
    'fetch' => PDO::FETCH_ASSOC,
  ));
  foreach ($result as $link) {
    $out[] = $link['mlid'];
  }
  return $out;
}