You are here

public function views_handler::get_join in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 includes/handlers.inc \views_handler::get_join()
  2. 6.2 includes/handlers.inc \views_handler::get_join()

Get the join object that should be used for this handler.

This method isn't used a great deal, but it's very handy for easily getting the join if it is necessary to make some changes to it, such as adding an 'extra'.

1 call to views_handler::get_join()
views_handler_argument_many_to_one::summary_query in handlers/views_handler_argument_many_to_one.inc
Build the info for the summary query.

File

includes/handlers.inc, line 752
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

public function get_join() {

  // get the join from this table that links back to the base table.
  // Determine the primary table to seek.
  if (empty($this->query->relationships[$this->relationship])) {
    $base_table = $this->query->base_table;
  }
  else {
    $base_table = $this->query->relationships[$this->relationship]['base'];
  }
  $join = views_get_table_join($this->table, $base_table);
  if ($join) {
    return clone $join;
  }
}