You are here

function node_service_service in Services 7

Same name and namespace in other branches
  1. 5 services/node_service/node_service.module \node_service_service()
  2. 6 services/node_service/node_service.module \node_service_service()
  3. 6.2 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',
      ),
      '#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.view
    array(
      '#method' => 'node.view',
      '#callback' => 'node_service_view',
      '#access callback' => 'node_service_view_access',
      '#file' => array(
        'file' => 'inc',
        'module' => 'node_service',
      ),
      '#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.'),
        ),
        array(
          '#name' => 'teaser',
          '#type' => 'boolean',
          '#optional' => TRUE,
          '#description' => t('Is this a teaser version of the node?'),
        ),
        array(
          '#name' => 'page',
          '#type' => 'boolean',
          '#optional' => TRUE,
          '#description' => t('Is this a page version of the node?'),
        ),
      ),
      '#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.'),
    ),
  );
}