function _user_resource_index in Services 7.3
Same name and namespace in other branches
- 6.3 resources/user_resource.inc \_user_resource_index()
Return an array of optionally paged uids based on a set of criteria.
An example request might look like
http://domain/endpoint/user?fields=uid,name,mail¶meters[uid]=1
This would return an array of objects with only uid, name and mail defined, where uid = 1.
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 user objects.
See also
_node_resource_index() for more notes
1 string reference to '_user_resource_index'
- _user_resource_definition in resources/
user_resource.inc
File
- resources/
user_resource.inc, line 896
Code
function _user_resource_index($page, $fields, $parameters, $page_size, $options = array()) {
$user_select = db_select('users', 't');
services_resource_build_index_query($user_select, $page, $fields, $parameters, $page_size, 'user', $options);
$results = services_resource_execute_index_query($user_select);
return services_resource_build_index_list($results, 'user', 'uid');
}