You are here

function bean_services_index in Bean (for Drupal 7) 7

Return an array of optionally paged bids based on a set of criteria.

An example request might look like:

http://domain/endpoint/bean?fields=bid,label&parameters[type]=mytype

This would return an array of objects with only bid and label defined, where type = 'mytype'.

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 bean objects.

1 string reference to 'bean_services_index'
bean_services_resources in ./bean.services.inc
Implements hook_services_resources().

File

./bean.services.inc, line 260
Contains callbacks for service resource manipulation.

Code

function bean_services_index($page, $fields, $parameters, $page_size) {
  $bean_select = db_select('bean', 't')
    ->orderBy('delta', 'ASC');
  services_resource_build_index_query($bean_select, $page, $fields, $parameters, $page_size, 'bean');
  $results = services_resource_execute_index_query($bean_select);
  return services_resource_build_index_list($results, 'bean', 'bid');
}