DB_dsql::_render PHP Méthode

_render() public méthode

Helper for render(), which does the actual work.
public _render ( ) : string
Résultat string Resulting query
    public function _render()
    {
        /**/
        $this->app->pr->start('dsql/render');
        if (is_null($this->template)) {
            $this->SQLTemplate('select');
        }
        $self = $this;
        $res = preg_replace_callback('/\\[([a-z0-9_]*)\\]/', function ($matches) use($self) {
            /**/
            $self->app->pr->next('dsql/render/' . $matches[1], true);
            $fx = 'render_' . $matches[1];
            if (isset($self->args['custom'][$matches[1]])) {
                return $self->consume($self->args['custom'][$matches[1]], false);
            } elseif ($self->hasMethod($fx)) {
                return $self->{$fx}();
            } else {
                return $matches[0];
            }
        }, $this->template);
        /**/
        $this->app->pr->stop(null, true);
        return $res;
    }