function services_node_load in Services 5
Same name and namespace in other branches
- 6 services.module \services_node_load()
- 6.2 services.module \services_node_load()
- 7 services.module \services_node_load()
Make any changes we might want to make to node.
4 calls to services_node_load()
- node_service_load in services/
node_service/ node_service.module - Returns a specified node.
- node_service_view in services/
node_service/ node_service.module - taxonomy_service_select_nodes in services/
taxonomy_service/ taxonomy_service.module - select_nodes
- views_service_get_view in services/
views_service/ views_service.module - Get a view from the database.
File
- ./
services.module, line 580 - The module which provides the core code for drupal services
Code
function services_node_load($node, $fields = array()) {
if (!$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;
}