W3cubDocs

/Drupal 8

public function Connection::select

public Connection::select($table, $alias = NULL, array $options = array())

Prepares and returns a SELECT query object.

Parameters

string $table: The base table for this query, that is, the first table in the FROM clause. This table will also be used as the "base" table for query_alter hook implementations.

string $alias: (optional) The alias of the base table of this query.

$options: An array of options on the query.

Return value

\Drupal\Core\Database\Query\SelectInterface An appropriate SelectQuery object for this database connection. Note that it may be a driver-specific subclass of SelectQuery, depending on the driver.

See also

\Drupal\Core\Database\Query\Select

File

core/lib/Drupal/Core/Database/Connection.php, line 785

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

public function select($table, $alias = NULL, array $options = array()) {
  $class = $this->getDriverClass('Select');
  return new $class($table, $alias, $this, $options);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Connection.php/function/Connection::select/8.1.x