Views' join handlers

Same name in other branches
  1. 7.x-3.x includes/handlers.inc \views_join_handlers

Handlers to tell Views how to join tables together.

Here is how you do complex joins:

class views_join_complex extends views_join {
    // PHP 4 doesn't call constructors of the base class automatically from a
    // constructor of a derived class. It is your responsibility to propagate
    // the call to constructors upstream where appropriate.
    function construct($table = NULL, $left_table = NULL, $left_field = NULL, $field = NULL, $extra = array(), $type = 'LEFT') {
        parent::construct($table, $left_table, $left_field, $field, $extra, $type);
    }
    function join($table, &$query) {
        $output = parent::join($table, $query);
        $output .= "AND foo.bar = baz.boing";
        return $output;
    }

}

File

includes/handlers.inc, line 1528

Classes

Title Sort descending File name Summary
views_join includes/handlers.inc A function class to represent a join and create the SQL necessary
to implement the join.