buildSelect() public méthode

public buildSelect ( array $columns, array &$params, boolean $distinct = false, string $selectOption = null ) : string
$columns array
$params array the binding parameters to be populated
$distinct boolean
$selectOption string
Résultat string the SELECT clause built from [[Query::$select]].
 /**
  * @inheritdoc
  */
 public function buildSelect($columns, &$params, $distinct = false, $selectOption = null)
 {
     if (is_array($columns)) {
         foreach ($columns as $i => $column) {
             if (!is_string($column)) {
                 continue;
             }
             $matches = [];
             if (preg_match('/^(COUNT|SUM|AVG|MIN|MAX)\\([\\{\\[]{0,2}(\\w+|\\*)[\\}\\]]{0,2}\\)$/i', $column, $matches)) {
                 $function = $matches[1];
                 $alias = $matches[2] != '*' ? $matches[2] : 'ALL';
                 $columns[$i] = "{$column} AS {$function}_{$alias}";
             }
         }
     }
     return parent::buildSelect($columns, $params, $distinct, $selectOption);
 }