You are here

function sbp_test_node_load in Search by Page 7

Implements hook_node_load().

Manage the "private" flag on nodes. Code taken form the Node Access Example module on drupal.org.

File

tests/sbp_test.module, line 106
Module file for Search by Page testing.

Code

function sbp_test_node_load($nodes, $types) {
  $result = db_query('SELECT * FROM {sbp_test_access} WHERE nid IN(:nids)', array(
    ':nids' => array_keys($nodes),
  ))
    ->fetchAll();
  foreach ($result as $item) {
    $nodes[$item->nid]->test_private = $item->private;
  }
}