services_resource_build_index_list

  1. services
    1. 7.3
    2. 6.3
Versions
6.3 – 7.3 services_resource_build_index_list($results, $type, $field)

Helper function to build a list of items satisfying the index query.

Parameters

$results Object database query results object.

$type String type of index that is being processed.

$field String field to use for looking up uri.

▾ 6 functions call services_resource_build_index_list()

_comment_resource_index in resources/comment_resource.inc
Return an array of optionally paged cids baed on a set of criteria.
_file_resource_index in resources/file_resource.inc
Return an array of optionally paged fids baed on a set of criteria.
_node_resource_index in resources/node_resource.inc
Return an array of optionally paged nids baed on a set of criteria.
_taxonomy_term_resource_index in resources/taxonomy_resource.inc
Return an array of optionally paged tids baed on a set of criteria.
_taxonomy_vocabulary_resource_index in resources/taxonomy_resource.inc
Return an array of optionally paged vids baed on a set of criteria.
_user_resource_index in resources/user_resource.inc
Return an array of optionally paged uids baed on a set of criteria.

Code

./services.module, line 517

<?php
function services_resource_build_index_list($results, $type, $field) {
  // Put together array of matching items to return.
  $items = array();
  foreach ($results as $result) {
    if ($uri = services_resource_uri(array($type, $result->{$field}))) {
      $result->uri = $uri;
      if ($type == 'user') {
        services_remove_user_data($result);
      }
    }
    $items[] = $result;
  }

  return $items;
}
?>