function node_test_node_load

Implements hook_node_load().

File

modules/node/tests/node_test.module, line 14

Code

function node_test_node_load($nodes, $types) {
    // Add properties to each loaded node which record the parameters that were
    // passed in to this function, so the tests can check that (a) this hook was
    // called, and (b) the parameters were what we expected them to be.
    $nids = array_keys($nodes);
    ksort($nids);
    sort($types);
    foreach ($nodes as $node) {
        $node->node_test_loaded_nids = $nids;
        $node->node_test_loaded_types = $types;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.