public function changeToOuterJoin($aliases)
    {
        /* @var $join Join */
        /* @var $parent Join */
        while ($aliases) {
            $alias = array_pop($aliases);
            $join = $this->tableJoinsMap[$alias];

            // for the first join this should be true because its not a join
            // but a basetable that will be used in the from part of the query
            if (null == $join->getJoinType()) {
                continue;
            }

            // only the first alias is allowed to have null join type
            assert(null !== $join->getJoinType());

            $parentAlias = $join->getParentAlias();
            $parentIsOuter = ($parentAlias && LOUTER == $this->tableJoinsMap[$parentAlias]->getJoinType());
            $aliasIsOuter = (LOUTER == $join->getJoinType());

            if (($join->getNullable() || $parentIsOuter) && !$aliasIsOuter) {
                $this->tableJoinsMap[$alias] = $join->promote();
                // since we have just change the join type of alias we need to update
                // any thing else that refers to it
                foreach ($this->tableJoinsMap as $key => $join) {
                    if ($join->getParentAlias() == $alias &&
                        !ArrayHelper::hasKey($aliases, $key)
                    ) {
                        $aliases[] = $key;
                    }
                }
            }
        }
    }
public function changeToOuterJoin($aliases)
    {
        /* @var $join Join */
        /* @var $parent Join */
        while ($aliases) {
            $alias = array_pop($aliases);
            $join = $this->tableJoinsMap[$alias];

            // for the first join this should be true because its not a join
            // but a basetable that will be used in the from part of the query
            if (null == $join->getJoinType()) {
                continue;
            }

            // only the first alias is allowed to have null join type
            assert(null !== $join->getJoinType());

            $parentAlias = $join->getParentAlias();
            $parentIsOuter = ($parentAlias && LOUTER == $this->tableJoinsMap[$parentAlias]->getJoinType());
            $aliasIsOuter = (LOUTER == $join->getJoinType());

            if (($join->getNullable() || $parentIsOuter) && !$aliasIsOuter) {
                $this->tableJoinsMap[$alias] = $join->promote();
                // since we have just change the join type of alias we need to update
                // any thing else that refers to it
                foreach ($this->tableJoinsMap as $key => $join) {
                    if ($join->getParentAlias() == $alias &&
                        !ArrayHelper::hasKey($aliases, $key)
                    ) {
                        $aliases[] = $key;
                    }
                }
            }
        }
    }
public function changeToOuterJoin ( $ aliases ) { /* @var $join Join */ /* @var $parent Join */ while ( $ aliases ) { $ alias = array_pop ( $ aliases ) ; $ join = $ this -> tableJoinsMap [ $ alias ] ; // for the first join this should be true because its not a join // but a basetable that will be used in the from part of the query if ( null == $ join -> getJoinType ( ) ) { continue ; } // only the first alias is allowed to have null join type assert ( null !== $ join -> getJoinType ( ) ) ; $ parentAlias = $ join -> getParentAlias ( ) ; $ parentIsOuter = ( $ parentAlias && LOUTER == $ this -> tableJoinsMap [ $ parentAlias ] -> getJoinType ( ) ) ; $ aliasIsOuter = ( LOUTER == $ join -> getJoinType ( ) ) ; if ( ( $ join -> getNullable ( ) || $ parentIsOuter ) && ! $ aliasIsOuter ) { $ this -> tableJoinsMap [ $ alias ] = $ join -> promote ( ) ; // since we have just change the join type of alias we need to update // any thing else that refers to it foreach ( $ this -> tableJoinsMap as $ key => $ join ) { if ( $ join -> getParentAlias ( ) == $ alias && ! ArrayHelper :: hasKey ( $ aliases , $ key ) ) { $ aliases [ ] = $ key ; } } } } }
Promotes recursively the join type of given aliases and its children to
an outer join. If 'unconditional' is False, the join is only promoted if
it is nullable or the parent join is an outer join.

The children promotion is done to avoid join chains that contain a LOUTER b INNER c. So, if we have currently
a INNER b INNER c and a->b is promoted, then we must also promote b->c automatically, or otherwise the promotion
of a->b doesn't actually change anything in the query results.

@param $aliases

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
Promotes recursively the join type of given aliases and its children to an outer join . If unconditional is False the join is only promoted if it is nullable or the parent join is an outer join .