You are here

function taxonomy_service_select_nodes in Services 7.3

Same name and namespace in other branches
  1. 5 services/taxonomy_service/taxonomy_service.module \taxonomy_service_select_nodes()
  2. 6.3 resources/taxonomy_resource.inc \taxonomy_service_select_nodes()
  3. 6 services/taxonomy_service/taxonomy_service.inc \taxonomy_service_select_nodes()
  4. 6.2 services/taxonomy_service/taxonomy_service.inc \taxonomy_service_select_nodes()
  5. 7 services/taxonomy_service/taxonomy_service.inc \taxonomy_service_select_nodes()

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.

Return value

An array of node objects.

See also

taxonomy_select_nodes()

1 string reference to 'taxonomy_service_select_nodes'
_taxonomy_resource_definition in resources/taxonomy_resource.inc
@file Link general taxonomy functionalities to services module.

File

resources/taxonomy_resource.inc, line 563
Link general taxonomy functionalities to services module.

Code

function taxonomy_service_select_nodes($tid = '', $pager, $limit, $order) {
  $result = taxonomy_select_nodes($tid, (bool) $pager, $limit, $order);
  foreach ($result as $nid) {
    $node = node_load($nid);
    if ($uri = services_resource_uri(array(
      'node',
      $nid,
    ))) {
      $node->uri = $uri;
    }
    $nodes[] = $node;
  }
  if (empty($nodes)) {
    return services_error(t('No nodes were found with tid @tid', array(
      '@tid' => $tid,
    )), 404);
  }
  return $nodes;
}