You are here

function nodesymlinks_get_items_by_nid in NodeSymlinks 7

Same name and namespace in other branches
  1. 6 nodesymlinks.inc \nodesymlinks_get_items_by_nid()

Load all duplicate menulinks from database for given node nid.

Returns array of mlid and link_path.

1 call to nodesymlinks_get_items_by_nid()
_nodesymlinks_nodeapi_insert_update in ./nodesymlinks.inc
Implements hook_nodeapi() OP: Insert & Update.

File

./nodesymlinks.inc, line 31
Main NodeSymlinks callbacks

Code

function nodesymlinks_get_items_by_nid($nid) {
  return db_query("SELECT mlid, link_path FROM {menu_links} WHERE module = :module AND link_path LIKE :link_path", array(
    ':module' => 'nodesymlinks',
    ':link_path' => "node/{$nid}/mid/%",
  ))
    ->fetchAllAssoc('mlid');
}