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

Implements SelectQueryInterface::fields().

Return value

SelectQuery:

Overrides SelectQueryInterface::fields

File

includes/database/select.inc, line 1484

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;
}