src/Query.php
protected function _render_field($add_alias = true)
    {
        // will be joined for output
        $ret = [];

        // If no fields were defined, use defaultField
        if (empty($this->args['field'])) {
            if ($this->defaultField instanceof Expression) {
                return $this->_consume($this->defaultField);
            }

            return (string) $this->defaultField;
        }

        // process each defined field
        foreach ($this->args['field'] as $alias => $field) {
            // Do not add alias, if:
            //  - we don't want aliases OR
            //  - alias is the same as field OR
            //  - alias is numeric
            if (
                $add_alias === false
                || (is_string($field) && $alias === $field)
                || is_numeric($alias)
            ) {
                $alias = null;
            }

            // Will parameterize the value and escape if necessary
            $field = $this->_consume($field, 'soft-escape');

            if ($alias) {
                // field alias cannot be expression, so simply escape it
                $field .= ' '.$this->_escape($alias);
            }

            $ret[] = $field;
        }

        return implode(',', $ret);
    }
protected function _render_field($add_alias = true)
    {
        // will be joined for output
        $ret = [];

        // If no fields were defined, use defaultField
        if (empty($this->args['field'])) {
            if ($this->defaultField instanceof Expression) {
                return $this->_consume($this->defaultField);
            }

            return (string) $this->defaultField;
        }

        // process each defined field
        foreach ($this->args['field'] as $alias => $field) {
            // Do not add alias, if:
            //  - we don't want aliases OR
            //  - alias is the same as field OR
            //  - alias is numeric
            if (
                $add_alias === false
                || (is_string($field) && $alias === $field)
                || is_numeric($alias)
            ) {
                $alias = null;
            }

            // Will parameterize the value and escape if necessary
            $field = $this->_consume($field, 'soft-escape');

            if ($alias) {
                // field alias cannot be expression, so simply escape it
                $field .= ' '.$this->_escape($alias);
            }

            $ret[] = $field;
        }

        return implode(',', $ret);
    }
Returns template component for [field].

@param bool $add_alias Should we add aliases, see _render_field_noalias()

@return string Parsed template chunk