function SelectQuery::fields

Overrides SelectQueryInterface::fields

File

includes/database/select.inc, line 1347

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.