public function getClause(&$params)
    {
        if (null === $this->joinCondition) {
            $conditions = array();
            for ($i = 0; $i < $this->count; $i++) {
                $conditions [] = $this->getLeftColumn($i) . $this->getOperator($i) . $this->getRightColumn($i);
            }
            $joinCondition = sprintf('(%s)', implode($conditions, ' AND '));
        } else {
            $joinCondition = '';
            $this->getJoinCondition()->appendPsTo($joinCondition, $params);
        }

        $rightTableName = $this->getRightTableWithAlias();

        if (null !== $this->db && $this->db->useQuoteIdentifier()) {
            $rightTableName = $this->db->quoteIdentifierTable($rightTableName);
        }

        return sprintf('%s %s ON %s',
            $this->getJoinType(),
            $rightTableName,
            $joinCondition
        );
    }
public function getClause(&$params)
    {
        if (null === $this->joinCondition) {
            $conditions = array();
            for ($i = 0; $i < $this->count; $i++) {
                $conditions [] = $this->getLeftColumn($i) . $this->getOperator($i) . $this->getRightColumn($i);
            }
            $joinCondition = sprintf('(%s)', implode($conditions, ' AND '));
        } else {
            $joinCondition = '';
            $this->getJoinCondition()->appendPsTo($joinCondition, $params);
        }

        $rightTableName = $this->getRightTableWithAlias();

        if (null !== $this->db && $this->db->useQuoteIdentifier()) {
            $rightTableName = $this->db->quoteIdentifierTable($rightTableName);
        }

        return sprintf('%s %s ON %s',
            $this->getJoinType(),
            $rightTableName,
            $joinCondition
        );
    }
public function getClause ( & $ params ) { if ( null === $ this -> joinCondition ) { $ conditions = array ( ) ; for ( $ i = 0 ; $ i < $ this -> count ; $ i ++ ) { $ conditions [ ] = $ this -> getLeftColumn ( $ i ) . $ this -> getOperator ( $ i ) . $ this -> getRightColumn ( $ i ) ; } $ joinCondition = sprintf ( '(%s)' , implode ( $ conditions , ' AND ' ) ) ; } else { $ joinCondition = '' ; $ this -> getJoinCondition ( ) -> appendPsTo ( $ joinCondition , $ params ) ; } $ rightTableName = $ this -> getRightTableWithAlias ( ) ; if ( null !== $ this -> db && $ this -> db -> useQuoteIdentifier ( ) ) { $ rightTableName = $ this -> db -> quoteIdentifierTable ( $ rightTableName ) ; } return sprintf ( '%s %s ON %s' , $ this -> getJoinType ( ) , $ rightTableName , $ joinCondition ) ; }
Get the join clause for this Join.
If the join condition needs binding, uses the passed params array.

@example
<code>
$join = new Join();
$join->addExplicitCondition('book', 'AUTHOR_ID', null, 'author', 'ID');
$params = array();
echo $j->getClause($params);
// 'LEFT JOIN author ON (book.AUTHOR_ID=author.ID)'
</code>

@param array &$params

@return string SQL join clause with join condition
Get the join clause for this Join . If the join condition needs binding uses the passed params array .