You are here

function services_views_services_resources in Services Views 6

Same name and namespace in other branches
  1. 7 services_views.module \services_views_services_resources()

Implementation of hook_services_resources().

File

./services_views.module, line 19
Provides a generic but powerful API for web services.

Code

function services_views_services_resources() {
  $resources['views'] = array();
  $resources['views']['retrieve'] = array(
    'help' => 'Retrieves a view.',
    'file' => array(
      'type' => 'inc',
      'module' => 'services_views',
      'name' => 'services_views.resource',
    ),
    'callback' => 'services_views_retrieve',
    'access callback' => 'services_views_access',
    'access arguments' => array(
      'view',
    ),
    'access arguments append' => TRUE,
    'args' => array(
      'view_name' => array(
        'name' => 'view_name',
        'type' => 'string',
        'description' => 'The name of the view to get.',
        'source' => array(
          'path' => '0',
        ),
        'optional' => FALSE,
      ),
      'display_id' => array(
        'name' => 'display_id',
        'type' => 'string',
        'description' => 'The display ID of the view to get.',
        'source' => array(
          'param' => 'display_id',
        ),
        'optional' => TRUE,
        'default value' => 'default',
      ),
      'args' => array(
        'name' => 'args',
        'type' => 'array',
        'description' => 'A list of arguments to pass to the view.',
        'source' => array(
          'param' => 'args',
        ),
        'optional' => TRUE,
        'default value' => array(),
      ),
      'offset' => array(
        'name' => 'offset',
        'type' => 'int',
        'description' => 'The number of the entry for the page begin with.',
        'source' => array(
          'param' => 'offset',
        ),
        'optional' => TRUE,
        'default value' => 0,
      ),
      'limit' => array(
        'name' => 'limit',
        'type' => 'int',
        'description' => 'The total number of entries to list.',
        'source' => array(
          'param' => 'limit',
        ),
        'optional' => TRUE,
        'default value' => 10,
      ),
      'theme_output' => array(
        'name' => 'theme_output',
        'type' => 'bool',
        'description' => 'Whether to return the raw data results or style the results.',
        'source' => array(
          'param' => 'theme_output',
        ),
        'optional' => TRUE,
        'default value' => FALSE,
      ),
      'filters' => array(
        'name' => 'filters',
        'type' => 'array',
        'description' => 'A list of filters to pass to the view.  These are defined by the exposed filters on your view.  Example call: <code>/views/your_view?filters[nid]=12345</code>',
        'source' => array(
          'param' => 'filters',
        ),
        'optional' => TRUE,
        'default value' => array(),
      ),
    ),
  );
  return $resources;
}