DB_dsql::render_join PHP Méthode

render_join() public méthode

Renders [join].
public render_join ( ) : string
Résultat string rendered SQL chunk
    public function render_join()
    {
        if (!$this->args['join']) {
            return '';
        }
        $joins = array();
        foreach ($this->args['join'] as $j) {
            $jj = '';
            $jj .= $j['t'] . ' join ';
            $jj .= $this->bt($j['f1']);
            if (!is_null($j['fa'])) {
                $jj .= ' as ' . $this->bt($j['fa']);
            }
            $jj .= ' on ';
            if ($j['expr']) {
                $jj .= $this->consume($j['expr']);
            } else {
                $jj .= $this->bt($j['fa'] ?: $j['f1']) . '.' . $this->bt($j['f2']) . ' = ' . $this->bt($j['m1']) . '.' . $this->bt($j['m2']);
            }
            $joins[] = $jj;
        }
        return implode(' ', $joins);
    }