You are here

function webform_service_resource_index in Webform Service 7.4

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

Parameters

array $params:

  • $page (int) Page number of results to return (in pages of 20).
  • $search (string A keyword being searched for.
  • $page_size (int) The number of items to be returned.

$function: The function (as a string) called to get the index we want.

$query: The entity field query.

Return value

An array of node objects.

1 call to webform_service_resource_index()
_webform_resource_index in resources/webform_resource.inc
Return an array of optionally paged nids baed on a set of criteria.

File

./webform_service.module, line 386

Code

function webform_service_resource_index($type, $result) {
  $items = array();
  if (!empty($result['node'])) {
    $entities = entity_load('node', array_keys($result['node']));
    foreach ($entities as $entity) {
      $item = webform_service_get_resource($entity);
      if ($item) {
        $items[] = $item;
      }
    }
  }
  return $items;
}