You are here

function commerce_addressbook_retrieve_view in Commerce Addressbook 7.3

Same name and namespace in other branches
  1. 7.2 commerce_addressbook.module \commerce_addressbook_retrieve_view()

Retrieves the specified view.

Parameters

$name: The name of the view to retrieve.

$display_id: The ID of the display of the view.

$arguments: An array of arguments to pass to the view.

$override_url: A url that overrides the url of the current view.

Return value

The view object, you'll have to call render if to render it.

2 calls to commerce_addressbook_retrieve_view()
commerce_addressbook_profile_options_default in includes/commerce_addressbook.user.inc
Page callback for setting a customer profile as default. Used for both ajax and non-ajax delivery of the customer profile updates.
commerce_addressbook_profile_page in includes/commerce_addressbook.user.inc
Page callback for listing customer profiles of a certain type.

File

./commerce_addressbook.module, line 393
Defines addressbook functionality for customer profiles, allowing them to be reused and managed on a per-user basis.

Code

function commerce_addressbook_retrieve_view($name, $display_id, $arguments, $override_url = '') {

  // Load the specified view.
  $view = views_get_view($name);
  $view
    ->set_display($display_id);

  // Set the specific arguments passed in.
  $view
    ->set_arguments($arguments);

  // Override the view url, if an override was provided.
  if (!empty($override_url)) {
    $view->override_url = $override_url;
  }

  // Prepare and execute the view query.
  $view
    ->pre_execute();
  $view
    ->execute();
  return $view;
}