You are here

function NodeDisplaysPlugins::_nd_build_object in Node displays 6.3

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

Helper function to build an object.

Parameters

stdClass $object A node.:

$build_mode The build mode for the node.:

File

tests/nd.plugins.test, line 32
Tests for Node displays (plugins)

Class

NodeDisplaysPlugins
@file Tests for Node displays (plugins)

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;
}