You are here

function views_service_get in Services 6

Same name and namespace in other branches
  1. 6.2 services/views_service/views_service.inc \views_service_get()
  2. 7 services/views_service/views_service.inc \views_service_get()

Get a view from the database.

Parameters

$view_name: String. The views name.

$display_id: String (optional).

$args: Array (optional). A list of params.

Return value

Array. The views return.

1 string reference to 'views_service_get'
views_service_service in services/views_service/views_service.module
Implementation of hook_service().

File

services/views_service/views_service.inc, line 20
@author Services Dev Team

Code

function views_service_get($view_name, $fields = array(), $args = array(), $offset = 0, $limit = 0) {
  $view = views_get_view($view_name);

  // Put all arguments and then execute
  $view
    ->set_arguments($args, FALSE);
  $view
    ->set_offset($offset);
  $view
    ->set_items_per_page($limit);
  $view
    ->execute();
  return $view->result;
}