You are here

public function SelectQuery::__construct in Drupal 7

Constructs a Query object.

Parameters

DatabaseConnection $connection: Database connection object.

array $options: Array of query options.

Overrides Query::__construct

File

includes/database/select.inc, line 967

Class

SelectQuery
Query builder for SELECT statements.

Code

public function __construct($table, $alias, DatabaseConnection $connection, $options = array()) {
  $options['return'] = Database::RETURN_STATEMENT;
  parent::__construct($connection, $options);
  $this->where = new DatabaseCondition('AND');
  $this->having = new DatabaseCondition('AND');
  $this
    ->addJoin(NULL, $table, $alias);
}