You are here

function menu_node_views_relationship_double::init in Menu Node Views 7.2

Init handler to let relationships live on tables other than the table they operate on. TODO: check necessity and validity

Overrides views_handler_relationship::init

File

includes/menu_node_views_relationship_double.inc, line 27

Class

menu_node_views_relationship_double
Relationship handler to create a double jointure, ie through 2 tables: from the base table to the final table through the relation table

Code

function init(&$view, &$options) {
  parent::init($view, $options);
  if (isset($this->definition['relationship table'])) {
    $this->table = $this->definition['relationship table'];
  }
  if (isset($this->definition['relationship field'])) {

    // Set both real_field and field so custom handler
    // can rely on the old field value.
    $this->real_field = $this->field = $this->definition['relationship field'];
  }
}