You are here

function hook_menu_node_invoke_update in Menu Node API 7

When a node or its menu item are updated, notify other modules.

Note that this hook runs for each menu item that belongs to the node (yes, core allows that), so normally you would use $link->mlid as the primary key.

Parameters

$link: An object representing a single row from the {menu_links} table. This object defines the menu link and can be used to load additional data using menu_get_item().

$node: The node object being acted upon.

1 function implements hook_menu_node_invoke_update()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

menu_node_test_menu_node_invoke_update in tests/menu_node_test.module
Implements hook_menu_node_invoke_update().

File

./menu_node.api.php, line 48
Menu Node API API documentation file for the Menu Node API module.

Code

function hook_menu_node_invoke_update($link, $node) {

  // Update data in my custom table, which tracks the owners of nodes
  // placed in the site menu.
  $record = array(
    'nid' => $node->nid,
    'mlid' => $link->mlid,
    'uid' => $node->uid,
  );
  drupal_write_record('mytable', $record, array(
    'mlid',
    'uid',
  ));
}