You are here

function NodeDisplaysRegions::_nd_build_object in Node displays 6.3

Same name and namespace in other branches
  1. 6 tests/nd.regions.test \NodeDisplaysRegions::_nd_build_object()
  2. 6.2 tests/nd.regions.test \NodeDisplaysRegions::_nd_build_object()
  3. 7 tests/nd.regions.test \NodeDisplaysRegions::_nd_build_object()

Helper function to build an object.

Parameters

stdClass $object A node.:

$build_mode The build mode for the node.:

1 call to NodeDisplaysRegions::_nd_build_object()
NodeDisplaysRegions::testRendering in tests/nd.regions.test
Test if nodeapi & preprocess do their job good by excluding fields and putting them in the right region.

File

tests/nd.regions.test, line 57
Tests for Node displays (regions)

Class

NodeDisplaysRegions
@file Tests for Node displays (regions)

Code

function _nd_build_object($object, $build_mode = NODE_BUILD_NORMAL, $teaser = FALSE, $page = TRUE) {
  $object_loaded = node_load($object->nid, array(), TRUE);
  $object_loaded->build_mode = $build_mode;
  $object_rendered = node_build_content($object_loaded, $teaser, $page);
  node_invoke_nodeapi($object_rendered, 'alter', $teaser, $page);
  return $object_rendered;
}