function views_join::construct

Construct the views_join object.

1 call to views_join::construct()
views_join_subquery::construct in includes/handlers.inc
Construct the views_join object.
1 method overrides views_join::construct()
views_join_subquery::construct in includes/handlers.inc
Construct the views_join object.

File

includes/handlers.inc, line 1600

Class

views_join
A function class to represent a join and create the SQL necessary to implement the join.

Code

public function construct($table = NULL, $left_table = NULL, $left_field = NULL, $field = NULL, $extra = array(), $type = 'LEFT') {
    $this->extra_type = 'AND';
    if (!empty($table)) {
        $this->table = $table;
        $this->left_table = $left_table;
        $this->left_field = $left_field;
        $this->field = $field;
        $this->extra = $extra;
        $this->type = strtoupper($type);
    }
    elseif (!empty($this->definition)) {
        // If no arguments, construct from definition. These four must exist or
        // it will throw notices.
        $this->table = $this->definition['table'];
        $this->left_table = $this->definition['left_table'];
        $this->left_field = $this->definition['left_field'];
        $this->field = $this->definition['field'];
        if (!empty($this->definition['extra'])) {
            $this->extra = $this->definition['extra'];
        }
        if (!empty($this->definition['extra type'])) {
            $this->extra_type = strtoupper($this->definition['extra type']);
        }
        $this->type = !empty($this->definition['type']) ? strtoupper($this->definition['type']) : 'LEFT';
    }
}