You are here

taxonomy_service.module in Services 6

@author Services Dev Team

Link general taxonomy functionalities to services module.

File

services/taxonomy_service/taxonomy_service.module
View source
<?php

/**
 * @author Services Dev Team
 * @file
 *  Link general taxonomy functionalities to services module.
 */

/**
 * Implementation of hook_help().
 */
function taxonomy_service_help($path, $arg) {
  switch ($path) {
    case 'admin/help#services_taxonomy':
      return t('<p>Provides taxonomy methods to services applications.  Requires services.module.</p>');
    case 'admin/modules#description':
      return t('Provides taxonomy methods to services applications.  Requires services.module.');
  }
}

/**
 * Implementation of hook_service().
 */
function taxonomy_service_service() {
  return array(
    array(
      '#method' => 'taxonomy.getTree',
      '#callback' => 'taxonomy_service_get_tree',
      '#file' => array(
        'file' => 'inc',
        'module' => 'taxonomy_service',
      ),
      '#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',
      '#file' => array(
        'file' => 'inc',
        'module' => 'taxonomy_service',
      ),
      '#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.'),
    ),
  );
}

Functions

Namesort descending Description
taxonomy_service_help Implementation of hook_help().
taxonomy_service_service Implementation of hook_service().