function services_node_load in Services 7
Same name and namespace in other branches
- 5 services.module \services_node_load()
- 6 services.module \services_node_load()
- 6.2 services.module \services_node_load()
Make any changes we might want to make to node.
5 calls to services_node_load()
- node_service_get in services/
node_service/ node_service.inc - Returns a specified node.
- node_service_view in services/
node_service/ node_service.inc - Returns a specified node.
- search_service_nodes in services/
search_service/ search_service.inc - Callback for search.nodes service.
- taxonomy_service_select_nodes in services/
taxonomy_service/ taxonomy_service.inc - Services interface to taxonomy_select_nodes().
- views_service_get in services/
views_service/ views_service.inc - Get a view from the database.
File
- ./
services.module, line 617 - @author Services Dev Team
Code
function services_node_load($node, $fields = array()) {
if (!isset($node->nid)) {
return NULL;
}
// Loop through and get only requested fields
if (count($fields) > 0) {
foreach ($fields as $field) {
$val->{$field} = $node->{$field};
}
}
else {
$val = $node;
}
return $val;
}