function node_service_get in Services 7
Same name and namespace in other branches
- 6 services/node_service/node_service.inc \node_service_get()
- 6.2 services/node_service/node_service.inc \node_service_get()
Returns a specified node.
Parameters
$nid: Number. The node ID.
$fields: Array (optinonal). The node fields needed. If its empty, all fields will be returned
Return value
Object. The node object with all wanted fields.
1 string reference to 'node_service_get'
- node_service_service in services/
node_service/ node_service.module - Implementation of hook_service().
File
- services/
node_service/ node_service.inc, line 19 - @author Services Dev Team
Code
function node_service_get($nid, $fields = array()) {
if (!($node = services_node_load(node_load(array(
'nid' => $nid,
)), $fields))) {
return services_error(t('Could not find the node.'), 401);
}
return $node;
}