source/Spiral/ORM/Entities/Loaders/Traits/ColumnsTrait.php
protected function mountColumns(
        SelectQuery $query,
        bool $minify = false,
        string $prefix = '',
        bool $overwrite = false
    ) {
        //Column source alias
        $alias = $this->getAlias();

        $columns = $overwrite ? [] : $query->getColumns();
        foreach ($this->getColumns() as $name) {
            $column = $name;

            if ($minify) {
                //Let's use column number instead of full name
                $column = 'c' . count($columns);
            }

            $columns[] = "{$alias}.{$name} AS {$prefix}{$column}";
        }

        //Updating column set
        $query->columns($columns);
    }
protected function mountColumns(
        SelectQuery $query,
        bool $minify = false,
        string $prefix = '',
        bool $overwrite = false
    ) {
        //Column source alias
        $alias = $this->getAlias();

        $columns = $overwrite ? [] : $query->getColumns();
        foreach ($this->getColumns() as $name) {
            $column = $name;

            if ($minify) {
                //Let's use column number instead of full name
                $column = 'c' . count($columns);
            }

            $columns[] = "{$alias}.{$name} AS {$prefix}{$column}";
        }

        //Updating column set
        $query->columns($columns);
    }
protected function mountColumns ( SelectQuery $ query , bool $ minify = false , string $ prefix = '' , bool $ overwrite = false ) { //Column source alias $ alias = $ this -> getAlias ( ) ; $ columns = $ overwrite ? [ ] : $ query -> getColumns ( ) ; foreach ( $ this -> getColumns ( ) as $ name ) { $ column = $ name ; if ( $ minify ) { //Let's use column number instead of full name $ column = 'c' . count ( $ columns ) ; } $ columns [ ] = "{$alias}.{$name} AS {$prefix}{$column}" ; } //Updating column set $ query -> columns ( $ columns ) ; }
Set columns into SelectQuery.

@param SelectQuery $query
@param bool        $minify    Minify column names (will work in case when query parsed in
FETCH_NUM mode).
@param string      $prefix    Prefix to be added for each column name.
@param bool        $overwrite When set to true existed columns will be removed.
Set columns into SelectQuery .