You are here

taxonomy_service.inc in Services 7

@author Services Dev Team

Link general taxonomy functionalities to services module.

File

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

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

/**
 * Services interface to taxonomy_get_tree().
 *
 * @see
 *   taxonomy_get_tree()
 */
function taxonomy_service_get_tree($vid, $parent = 0, $max_depth = NULL) {
  return taxonomy_get_tree($vid, $parent, -1, $max_depth);
}

/**
 * Services interface to taxonomy_select_nodes().
 *
 * Note that where taxonomy_select_nodes() returns the results
 * of a db_query(), this function returns an array of node objects.
 *
 * @see
 *   taxonomy_select_nodes().
 * @return 
 *   An array of node objects.
 */
function taxonomy_service_select_nodes($tids = array(), $fields = array(), $operator = 'or', $depth = 0, $pager = TRUE, $order = 'n.sticky DESC, n.created DESC') {
  $result = taxonomy_select_nodes($tids, $operator, $depth, $pager, $order);
  while ($node = db_fetch_object($result)) {
    $nodes[] = services_node_load(node_load($node->nid), $fields);
  }
  return $nodes;
}

/**
 * Services interface to taxonomy_save_term().
 *
 * @see
 *   taxonomy_save_term().
 */
function taxonomy_service_save_term($term) {
  if (!is_array($term)) {
    $term = (array) $term;
  }
  return taxonomy_save_term($term);
}

/**
 * Services interface to taxonomy_save_vocabulary().
 *
 * @see
 *   taxonomy_save_vocabulary().
 */
function taxonomy_service_save_vocabulary($vocabulary) {
  if (!is_array($vocabulary)) {
    $vocabulary = (array) $vocabulary;
  }
  return taxonomy_save_vocabulary($vocabulary);
}

Functions

Namesort descending Description
taxonomy_service_get_tree Services interface to taxonomy_get_tree().
taxonomy_service_save_term Services interface to taxonomy_save_term().
taxonomy_service_save_vocabulary Services interface to taxonomy_save_vocabulary().
taxonomy_service_select_nodes Services interface to taxonomy_select_nodes().