function node_example_load in Examples for Developers 6
Implementation of hook_load().
Now that we've defined how to manage the node data in the database, we need to tell Drupal how to get the node back out. This hook is called every time a node is loaded, and allows us to do some loading of our own.
Related topics
File
- node_example/
node_example.module, line 264 - This is an example outlining how a module can be used to define a new node type.
Code
function node_example_load($node) {
$additions = db_fetch_object(db_query('SELECT color, quantity FROM {node_example} WHERE vid = %d', $node->vid));
return $additions;
}