node_example_load

Versions
4.6 – 7
node_example_load($node)

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

developer/examples/node_example.module, line 211

<?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;
}
?>
Login or register to post comments
 
 

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.