1 select.inc public SelectQuery::fields($table_alias, array $fields = array())

Return value

SelectQuery:

Overrides SelectQueryInterface::fields

File

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

Class

SelectQuery
Query builder for SELECT statements.

Code

public function fields($table_alias, array $fields = array()) {

  if ($fields) {
    foreach ($fields as $field) {
      // We don't care what alias was assigned.
      $this->addField($table_alias, $field);
    }
  }
  else {
    // We want all fields from this table.
    $this->tables[$table_alias]['all_fields'] = TRUE;
  }

  return $this;
}