function hook_load

7.x node.api.php hook_load($nodes)
6.x node.php hook_load($node)

Load node-type-specific information.

This is a hook used by node modules. It is called to allow the module a chance to load extra information that it stores about a node, or possibly replace already loaded information - which can be dangerous.

Parameters

$node: The node being loaded. At call time, node.module has already loaded the basic information about the node, such as its node ID (nid), title, and body.

Return value

An object containing properties of the node being loaded. This will be merged with the passed-in $node to result in an object containing a set of properties resulting from adding the extra properties to the passed-in ones, and overwriting the passed-in ones with the extra properties if they have the same name as passed-in properties.

For a detailed usage example, see node_example.module.

Related topics

21 functions implement hook_load()

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

actions_load in drupal-6.x/includes/actions.inc
Retrieve a single action from the database.
aggregator_category_load in drupal-6.x/modules/aggregator/aggregator.module
Load an aggregator category.
aggregator_feed_items_load in drupal-6.x/modules/aggregator/aggregator.pages.inc
Load feed items by passing a SQL query.
aggregator_feed_load in drupal-6.x/modules/aggregator/aggregator.module
Load an aggregator feed.
book_link_load in drupal-6.x/modules/book/book.module
Like menu_link_load(), but adds additional data from the {book} table.

... See full list

2 invocations of hook_load()
node_load in drupal-6.x/modules/node/node.module
Load a node object from the database.
user_load in drupal-6.x/modules/user/user.module
Fetch a user object.

File

documentation-6.x/developer/hooks/node.php, line 320
These hooks are defined by node modules, modules that define a new kind of node.

Code

function hook_load($node) {
  $additions = db_fetch_object(db_query('SELECT * FROM {mytable} WHERE vid = %d', $node->vid));
  return $additions;
}