src/Helper.php
public static function formatOn($on, $r = '')
    {
        if (isset($on[0]) && is_array($on[0])) {
            foreach ($on as $on2) {
                $r = self::formatOn($on2, $r);
            }
        } else {
            $on2 = array_keys($on);
            $r .= (!empty($r) ? ' AND ' : '').'`'.key($on).'`.`'.current($on).'` = `'.next($on2).'`.`'.next($on).'`';
        }

        return $r;
    }
public static function formatOn($on, $r = '')
    {
        if (isset($on[0]) && is_array($on[0])) {
            foreach ($on as $on2) {
                $r = self::formatOn($on2, $r);
            }
        } else {
            $on2 = array_keys($on);
            $r .= (!empty($r) ? ' AND ' : '').'`'.key($on).'`.`'.current($on).'` = `'.next($on2).'`.`'.next($on).'`';
        }

        return $r;
    }
public static function formatOn ( $ on , $ r = '' ) { if ( isset ( $ on [ 0 ] ) && is_array ( $ on [ 0 ] ) ) { foreach ( $ on as $ on2 ) { $ r = self :: formatOn ( $ on2 , $ r ) ; } } else { $ on2 = array_keys ( $ on ) ; $ r .= ( ! empty ( $ r ) ? ' AND ' : '' ) . '`' . key ( $ on ) . '`.`' . current ( $ on ) . '` = `' . next ( $ on2 ) . '`.`' . next ( $ on ) . '`' ; } return $ r ; }
SQL rendering for JOIN ON

@param array  $on
@param string $r

@return string
SQL rendering for JOIN ON