function _taxonomy_vocabulary_resource_index in Services 6.3
Same name and namespace in other branches
- 7.3 resources/taxonomy_resource.inc \_taxonomy_vocabulary_resource_index()
Return an array of optionally paged vids baed on a set of criteria.
An example request might look like
http://domain/endpoint/taxonomy_vocabulary?fields=vid,name¶meters[vi...
This would return an array of objects with only vid and name defined, where vid = 2.
@todo Support node types as parameters.
Parameters
$page: Page number of results to return (in pages of 20).
$fields: The fields you want returned.
$parameters: An array containing fields and values used to build a sql WHERE clause indicating items to retrieve.
$page_size: Integer number of items to be returned.
Return value
An array of vocabulary objects.
See also
1 string reference to '_taxonomy_vocabulary_resource_index'
- _taxonomy_resource_definition in resources/
taxonomy_resource.inc - @file Link general taxonomy functionalities to services module.
File
- resources/
taxonomy_resource.inc, line 395 - Link general taxonomy functionalities to services module.
Code
function _taxonomy_vocabulary_resource_index($page, $fields, $parameters, $page_size) {
$query = services_resource_build_index_query('vocabulary', 'v.weight DESC, v.name DESC', $page, $fields, $parameters, 'v', 'vid', $page_size, 'taxonomy_term');
$results = array();
while ($taxonomy = db_fetch_object($query)) {
$results[] = $taxonomy;
}
return services_resource_build_index_list($results, 'taxonomy_vocabulary', 'vid');
}