node_example_load

Definition

node_example_load($node)
developer/examples/node_example.module, line 234

Description

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.

Code

<?php
function node_example_load($node) {
  $additions = db_fetch_object(db_query('SELECT color, quantity FROM {node_example} WHERE vid = %d', $node->vid));
  return $additions;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.