| Versionen | |
|---|---|
| drupal7 | public DatabaseConnection::select($table, $alias = NULL, array $options = array()) |
Prepare and return a SELECT query object with the specified ID.
$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.
$alias The alias of the base table of this query.
$options An array of options on the query.
A new SelectQuery object.
includes/
<?php
public function select($table, $alias = NULL, array $options = array()) {
if (empty($this->selectClass)) {
$this->selectClass = 'SelectQuery_' . $this->driver();
if (!class_exists($this->selectClass)) {
$this->selectClass = 'SelectQuery';
}
}
$class = $this->selectClass;
// new is documented as the highest precedence operator so this will
// create a class named $class and pass the arguments into the constructor,
// instead of calling a function named $class with the arguments listed and
// then creating using the return value as the class name.
return new $class($table, $alias, $this, $options);
}
?>
Kommentare
Kommentar hinzufügen