function views_handler::set_relationship

cis7 handlers.inc views_handler::set_relationship()
cle7 handlers.inc views_handler::set_relationship()
elmsmedia7 handlers.inc views_handler::set_relationship()
icor7 handlers.inc views_handler::set_relationship()
meedjum_blog7 handlers.inc views_handler::set_relationship()
mooc7 handlers.inc views_handler::set_relationship()

Called just prior to query(), this lets a handler set up any relationship it needs.

File

sites/all/modules/ulmus/views/includes/handlers.inc, line 611
Defines the various handler objects to help build and display views.

Class

views_handler
Base handler, from which all the other handlers are derived. It creates a common interface to create consistency amongst handlers and data.

Code

function set_relationship() {
  // Ensure this gets set to something.
  $this->relationship = NULL;

  // Don't process non-existant relationships.
  if (empty($this->options['relationship']) || $this->options['relationship'] == 'none') {
    return;
  }

  $relationship = $this->options['relationship'];

  // Ignore missing/broken relationships.
  if (empty($this->view->relationship[$relationship])) {
    return;
  }

  // Check to see if the relationship has already processed. If not, then we
  // cannot process it.
  if (empty($this->view->relationship[$relationship]->alias)) {
    return;
  }

  // Finally!
  $this->relationship = $this->view->relationship[$relationship]->alias;
}