src/Koldy/Db/Query/Select.php
public function fields(array $fields, string $alias = null): Select
    {
        $alias = ($alias === null) ? '' : "{$alias}.";

        foreach ($fields as $field => $as) {
            if (is_numeric($field)) {
                $this->field($alias . $as);
            } else {
                $this->field($alias . $field, $as);
            }
        }

        return $this;
    }
public function fields(array $fields, string $alias = null): Select
    {
        $alias = ($alias === null) ? '' : "{$alias}.";

        foreach ($fields as $field => $as) {
            if (is_numeric($field)) {
                $this->field($alias . $as);
            } else {
                $this->field($alias . $field, $as);
            }
        }

        return $this;
    }
public function fields ( array $ fields , string $ alias = null ) : Select { $ alias = ( $ alias === null ) ? '' : "{$alias}." ; foreach ( $ fields as $ field => $ as ) { if ( is_numeric ( $ field ) ) { $ this -> field ( $ alias . $ as ) ; } else { $ this -> field ( $ alias . $ field , $ as ) ; } } return $ this ; }
Add fields to fetch by passing array of fields

@param array $fields
@param null|string $alias

@return Select
Add fields to fetch by passing array of fields