public function SelectQuery::__construct

7.x select.inc public SelectQuery::__construct($table, $alias = NULL, DatabaseConnection $connection, $options = array())

Constructs a Query object.

Parameters

DatabaseConnection $connection: Database connection object.

array $options: Array of query options.

Overrides Query::__construct

File

drupal-7.x/includes/database/select.inc, line 966

Class

SelectQuery
Query builder for SELECT statements.

Code

public function __construct($table, $alias = NULL, 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);
}