1 select.inc public SelectQueryExtender::addField($table_alias, $field, $alias = NULL)

Adds a field to the list to be SELECTed.

Parameters

string $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.

string $field: The name of the field.

string|null $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

string: The unique alias that was assigned for this field.

Overrides SelectQueryInterface::addField

File

core/includes/database/select.inc, line 862
Contains classes and interfaces for Select queries.

Class

SelectQueryExtender
The base extender class for Select queries.

Code

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