function _submission_resource_index in Webform Service 7.3
Return an array of optionally paged sids baed on a set of criteria.
An example request might look like
http://domain/endpoint/submissions?fields=nid,sid¶meters[nid]=7¶...
This would return an array of objects with only nid and vid defined, where nid = 7 and uid = 1.
@todo Evaluate the functionality here in general. Particularly around
- Do we need fields at all? Should this just return full submissions?
- Is there an easier syntax we can define which can make the urls for index requests more straightforward?
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 submissions objects.
1 string reference to '_submission_resource_index'
- webform_service_services_resources in ./
webform_service.module - Implements hook_services_resources().
File
- ./
webform_service.inc, line 208
Code
function _submission_resource_index($page, $fields, $parameters, $page_size) {
module_load_include('inc', 'services', 'services.module');
$submission_select = db_select('webform_submissions', 't')
->orderBy('submitted', 'DESC');
services_resource_build_index_query($submission_select, $page, $fields, $parameters, $page_size, 'webform_submission');
$results = services_resource_execute_index_query($submission_select);
return services_resource_build_index_list($results, 'webform_submission', 'sid');
}