function node_service_service in Services 6
Same name and namespace in other branches
- 5 services/node_service/node_service.module \node_service_service()
- 6.2 services/node_service/node_service.module \node_service_service()
- 7 services/node_service/node_service.module \node_service_service()
Implementation of hook_service().
File
- services/
node_service/ node_service.module, line 32 - @author Services Dev Team
Code
function node_service_service() {
return array(
// node.get
array(
'#method' => 'node.get',
'#callback' => 'node_service_get',
'#access callback' => 'node_service_get_access',
'#file' => array(
'file' => 'inc',
'module' => 'node_service',
),
'#key' => FALSE,
'#args' => array(
array(
'#name' => 'nid',
'#type' => 'int',
'#description' => t('A node ID.'),
),
array(
'#name' => 'fields',
'#type' => 'array',
'#optional' => TRUE,
'#description' => t('A list of fields to return.'),
),
),
'#return' => 'struct',
'#help' => t('Returns a node data.'),
),
// node.save
array(
'#method' => 'node.save',
'#callback' => 'node_service_save',
'#access callback' => 'node_service_save_access',
'#file' => array(
'file' => 'inc',
'module' => 'node_service',
),
'#args' => array(
array(
'#name' => 'node',
'#type' => 'struct',
'#description' => t('A node object. Upon creation, node object must include "type". Upon update, node object must include "nid" and "changed".'),
),
),
'#return' => 'struct',
'#help' => t('Save a node object into the database.'),
),
// node.delete
array(
'#method' => 'node.delete',
'#callback' => 'node_delete',
'#access callback' => 'node_service_delete_access',
'#file' => array(
'file' => 'inc',
'module' => 'node_service',
),
'#args' => array(
array(
'#name' => 'nid',
'#type' => 'int',
'#description' => t('A node ID.'),
),
),
'#help' => t('Delete a node.'),
),
);
}