You are here

function hook_services_views_execute_view_alter in Services Views 7

Alter results of the view execution.

An example is we can add total number of results as separate value in response.

Parameters

array $output: Results of the view execution. These will be sent to services for rendering.

object $view: Views object.

1 invocation of hook_services_views_execute_view_alter()
services_views_execute_view in ./services_views.resource.inc
Execute a view and return results.

File

./services_views.api.php, line 20
Documentation about hooks provided by services_views module.

Code

function hook_services_views_execute_view_alter(array &$output, $view) {
  if ($view->name == 'test') {
    $paged_output = array(
      'results' => $output,
      'total_rows' => $view->total_rows,
    );
    $output = $paged_output;
  }
}