You are here

function taxonomy_service_service in Services 5

Same name and namespace in other branches
  1. 6 services/taxonomy_service/taxonomy_service.module \taxonomy_service_service()
  2. 6.2 services/taxonomy_service/taxonomy_service.module \taxonomy_service_service()
  3. 7 services/taxonomy_service/taxonomy_service.module \taxonomy_service_service()

Implementation of hook_service().

File

services/taxonomy_service/taxonomy_service.module, line 23
The module which exposes services related to taxonomy system

Code

function taxonomy_service_service() {
  return array(
    array(
      '#method' => 'taxonomy.getTree',
      '#callback' => 'taxonomy_service_get_tree',
      '#args' => array(
        array(
          '#name' => 'vid',
          '#type' => 'int',
          '#description' => t('A vocabulary id.'),
        ),
      ),
      '#return' => 'struct',
      '#help' => t('Create a hierarchical representation of a vocabulary.'),
    ),
    array(
      '#method' => 'taxonomy.selectNodes',
      '#callback' => 'taxonomy_service_select_nodes',
      '#args' => array(
        array(
          '#name' => 'tids',
          '#type' => 'array',
          '#description' => t('An array of term IDs to match.'),
        ),
        array(
          '#name' => 'fields',
          '#type' => 'array',
          '#optional' => TRUE,
          '#description' => t('A list of fields to return.'),
        ),
        array(
          '#name' => 'operator',
          '#type' => 'string',
          '#optional' => TRUE,
          '#description' => t('How to interpret multiple IDs in the array. Can be "or" or "and".'),
        ),
        array(
          '#name' => 'depth',
          '#type' => 'string',
          '#optional' => TRUE,
          '#description' => t('How many levels deep to traverse the taxonomy tree. Can be a nonnegative integer or "all".'),
        ),
        array(
          '#name' => 'pager',
          '#type' => 'boolean',
          '#optional' => TRUE,
          '#description' => t('Whether the nodes are to be used with a pager (the case on most Drupal pages) or not (in an XML feed, for example).'),
        ),
        array(
          '#name' => 'order',
          '#type' => 'string',
          '#optional' => TRUE,
          '#description' => t('The order clause for the query that retrieve the nodes.'),
        ),
      ),
      '#return' => 'struct',
      '#help' => t('Finds all nodes that match selected taxonomy conditions.'),
    ),
  );
}