src/SqlGenerator.php
protected function generateJoinSQL()
        {
            $sql = ' FROM ' . $this->getTable()->getSelectFromSql();
            foreach ($this->query->getJoins() as $join) {
                $sql .= ' ' . $join->getJoinType() . ' ' . $join->getTable()->getSelectFromSql();
                $sql .= ' ON (' . Query::quoteIdentifier($join->getLeftColumn()) . Criterion::EQUALS . Query::quoteIdentifier($join->getRightColumn());

                if ($join->hasAdditionalCriteria()) {
                    $sql_parts = [];

                    foreach ($join->getAdditionalCriteria() as $criteria) {
                        $criteria->setQuery($this->query);
                        $sql_parts[] = $criteria->getSql();
                        foreach ($criteria->getValues() as $value) {
                            $this->query->addValue($value);
                        }
                    }

                    $sql .= ' AND ' . join(' AND ', $sql_parts);
                }

                $sql .= ')';
            }

            return $sql;
        }
protected function generateJoinSQL()
        {
            $sql = ' FROM ' . $this->getTable()->getSelectFromSql();
            foreach ($this->query->getJoins() as $join) {
                $sql .= ' ' . $join->getJoinType() . ' ' . $join->getTable()->getSelectFromSql();
                $sql .= ' ON (' . Query::quoteIdentifier($join->getLeftColumn()) . Criterion::EQUALS . Query::quoteIdentifier($join->getRightColumn());

                if ($join->hasAdditionalCriteria()) {
                    $sql_parts = [];

                    foreach ($join->getAdditionalCriteria() as $criteria) {
                        $criteria->setQuery($this->query);
                        $sql_parts[] = $criteria->getSql();
                        foreach ($criteria->getValues() as $value) {
                            $this->query->addValue($value);
                        }
                    }

                    $sql .= ' AND ' . join(' AND ', $sql_parts);
                }

                $sql .= ')';
            }

            return $sql;
        }
protected function generateJoinSQL ( ) { $ sql = ' FROM ' . $ this -> getTable ( ) -> getSelectFromSql ( ) ; foreach ( $ this -> query -> getJoins ( ) as $ join ) { $ sql .= ' ' . $ join -> getJoinType ( ) . ' ' . $ join -> getTable ( ) -> getSelectFromSql ( ) ; $ sql .= ' ON (' . Query :: quoteIdentifier ( $ join -> getLeftColumn ( ) ) . Criterion :: EQUALS . Query :: quoteIdentifier ( $ join -> getRightColumn ( ) ) ; if ( $ join -> hasAdditionalCriteria ( ) ) { $ sql_parts = [ ] ; foreach ( $ join -> getAdditionalCriteria ( ) as $ criteria ) { $ criteria -> setQuery ( $ this -> query ) ; $ sql_parts [ ] = $ criteria -> getSql ( ) ; foreach ( $ criteria -> getValues ( ) as $ value ) { $ this -> query -> addValue ( $ value ) ; } } $ sql .= ' AND ' . join ( ' AND ' , $ sql_parts ) ; } $ sql .= ')' ; } return $ sql ; }
Generate the "join" part of the sql

@return string
Generate the join part of the sql