function sheetnode_load in Sheetnode 7
Same name and namespace in other branches
- 6 sheetnode.module \sheetnode_load()
- 7.2 sheetnode.module \sheetnode_load()
Implements hook_load().
File
- ./
sheetnode.module, line 83 - Module file for the sheetnode module.
Code
function sheetnode_load($nodes) {
$vids = array();
foreach ($nodes as $node) {
$vids[] = $node->vid;
$nodes[$node->nid]->sheetnode = array(
'nid' => $node->nid,
'vid' => $node->vid,
'value' => NULL,
);
}
if (empty($vids)) {
return;
}
$sheetnodes = db_query("SELECT * FROM {sheetnode} WHERE vid IN (:vids)", array(
':vids' => $vids,
));
foreach ($sheetnodes as $sheetnode) {
$nodes[$sheetnode->nid]->sheetnode = (array) $sheetnode;
}
}