You are here

function hosting_site_data_node_load in Hosting 7.4

Same name and namespace in other branches
  1. 7.3 example/site_data/hosting_site_data.module \hosting_site_data_node_load()

Implements hook_node_load().

File

example/site_data/hosting_site_data.module, line 63
The hosting site data example.

Code

function hosting_site_data_node_load($nodes, $types) {
  foreach ($nodes as $nid => &$node) {
    if ($node->type == 'site') {

      // array instead
      $nodes[$nid]->site_data = db_query("SELECT site_data FROM {hosting_site_data} WHERE vid = :vid", array(
        ':vid' => $node->vid,
      ))
        ->fetchField();
    }
  }
}