DB_dsql::render_field PHP Méthode

render_field() public méthode

Returns template component [field].
public render_field ( ) : string
Résultat string Parsed template chunk
    public function render_field()
    {
        $result = array();
        if (!$this->args['fields']) {
            if ($this->default_field instanceof self) {
                return $this->consume($this->default_field);
            }
            return (string) $this->default_field;
        }
        foreach ($this->args['fields'] as $row) {
            list($field, $table, $alias) = $row;
            if ($alias === $field) {
                $alias = UNDEFINED;
            }
            /**/
            $this->app->pr->start('dsql/render/field/consume');
            $field = $this->consume($field);
            /**/
            $this->app->pr->stop();
            if (!$field) {
                $field = $table;
                $table = UNDEFINED;
            }
            if ($table && $table !== UNDEFINED) {
                $field = $this->bt($table) . '.' . $field;
            }
            if ($alias && $alias !== UNDEFINED) {
                $field .= ' ' . $this->bt($alias);
            }
            $result[] = $field;
        }
        return implode(',', $result);
    }