You are here

public function SearchByPageTesterTest::search_by_page_test_node_load in Search by Page 8

Implements hook_node_load().

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

File

tests/src/Functional/SearchByPageTesterTest.php, line 267
General Functional Tests for the Search by Page module. By Jennifer Hodgdon of Poplar ProductivityWare, www.poplarware.com

Class

SearchByPageTesterTest
Base class for testing Search by Page.

Namespace

Drupal\Tests\search_by_page\Functional

Code

public function search_by_page_test_node_load($nodes, $types) {
  $result = \Drupal::database()
    ->query('SELECT * FROM {search_by_page_test_access} WHERE nid IN(:nids)', array(
    ':nids' => array_keys($nodes),
  ))
    ->fetchAll();
  foreach ($result as $item) {
    $nodes[$item->nid]->test_private = $item->private;
  }
}