Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Select.php

function Select::fields

Overrides SelectInterface::fields

File

core/lib/Drupal/Core/Database/Query/Select.php, line 565

Class

Select
Query builder for SELECT statements.

Namespace

Drupal\Core\Database\Query

Code

public function fields($table_alias, array $fields = []) {
    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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal