function NodeDisplaysBuildModes::_nd_build_object in Node displays 6.2
Same name and namespace in other branches
- 6.3 tests/nd.buildmodes.test \NodeDisplaysBuildModes::_nd_build_object()
- 6 tests/nd.buildmodes.test \NodeDisplaysBuildModes::_nd_build_object()
- 7 tests/nd.buildmodes.test \NodeDisplaysBuildModes::_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 NodeDisplaysBuildModes::_nd_build_object()
- NodeDisplaysBuildModes::testBuildModesMatrix in tests/
nd.buildmodes.test - Test matrix build modes.
File
- tests/
nd.buildmodes.test, line 32 - Tests for Node displays (Build modes)
Class
- NodeDisplaysBuildModes
- @file Tests for Node displays (Build modes)
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;
}