public function SelectExtender::addField

public SelectExtender::addField($table_alias, $field, $alias = NULL)

Adds a field to the list to be SELECTed.

Parameters

$table_alias: The name of the table from which the field comes, as an alias. Generally you will want to use the return value of join() here to ensure that it is valid.

$field: The name of the field.

$alias: The alias for this field. If not specified, one will be generated automatically based on the $table_alias and $field. The alias will be checked for uniqueness, so the requested alias may not be the alias that is assigned in all cases.

Return value

The unique alias that was assigned for this field.

Overrides SelectInterface::addField

File

core/lib/Drupal/Core/Database/Query/SelectExtender.php, line 331

Class

SelectExtender
The base extender class for Select queries.

Namespace

Drupal\Core\Database\Query

Code

public function addField($table_alias, $field, $alias = NULL) {
  return $this->query->addField($table_alias, $field, $alias);
}

© 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!Query!SelectExtender.php/function/SelectExtender::addField/8.1.x