1 select.inc | public SelectQueryExtender::fields($table_alias, array $fields = array()) |
Add multiple fields from the same table to be selected.
This method does not return the aliases set for the passed fields. In the majority of cases that is not a problem, as the alias will be the field name. However, if you do need to know the alias you can call getFields() and examine the result to determine what alias was created. Alternatively, use addField() for the few fields you care about and this method for the rest.
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.
array $fields: An indexed array of fields present in the specified table that should be included in this query. If not specified, $table_alias.* will be generated without any aliases.
Return value
SelectQueryInterface: The called object.
Overrides SelectQueryInterface::fields
File
- core/
includes/ database/ select.inc, line 869 - Contains classes and interfaces for Select queries.
Class
- SelectQueryExtender
- The base extender class for Select queries.
Code
public function fields($table_alias, array $fields = array()) {
$this->query->fields($table_alias, $fields);
return $this;
}