src/Sulu/Component/Rest/ListBuilder/Doctrine/DoctrineListBuilder.php
protected function assignJoins(QueryBuilder $queryBuilder, array $joins = null)
    {
        if (null === $joins) {
            $joins = $this->getJoins();
        }

        foreach ($joins as $entity => $join) {
            switch ($join->getJoinMethod()) {
                case DoctrineJoinDescriptor::JOIN_METHOD_LEFT:
                    $queryBuilder->leftJoin(
                        $join->getJoin() ?: $entity,
                        $this->encodeAlias($entity),
                        $join->getJoinConditionMethod(),
                        $join->getJoinCondition()
                    );
                    break;
                case DoctrineJoinDescriptor::JOIN_METHOD_INNER:
                    $queryBuilder->innerJoin(
                        $join->getJoin() ?: $entity,
                        $this->encodeAlias($entity),
                        $join->getJoinConditionMethod(),
                        $join->getJoinCondition()
                    );
                    break;
            }
        }
    }
protected function assignJoins(QueryBuilder $queryBuilder, array $joins = null)
    {
        if (null === $joins) {
            $joins = $this->getJoins();
        }

        foreach ($joins as $entity => $join) {
            switch ($join->getJoinMethod()) {
                case DoctrineJoinDescriptor::JOIN_METHOD_LEFT:
                    $queryBuilder->leftJoin(
                        $join->getJoin() ?: $entity,
                        $this->encodeAlias($entity),
                        $join->getJoinConditionMethod(),
                        $join->getJoinCondition()
                    );
                    break;
                case DoctrineJoinDescriptor::JOIN_METHOD_INNER:
                    $queryBuilder->innerJoin(
                        $join->getJoin() ?: $entity,
                        $this->encodeAlias($entity),
                        $join->getJoinConditionMethod(),
                        $join->getJoinCondition()
                    );
                    break;
            }
        }
    }
protected function assignJoins ( QueryBuilder $ queryBuilder , array $ joins = null ) { if ( null === $ joins ) { $ joins = $ this -> getJoins ( ) ; } foreach ( $ joins as $ entity => $ join ) { switch ( $ join -> getJoinMethod ( ) ) { case DoctrineJoinDescriptor :: JOIN_METHOD_LEFT : $ queryBuilder -> leftJoin ( $ join -> getJoin ( ) ? : $ entity , $ this -> encodeAlias ( $ entity ) , $ join -> getJoinConditionMethod ( ) , $ join -> getJoinCondition ( ) ) ; break ; case DoctrineJoinDescriptor :: JOIN_METHOD_INNER : $ queryBuilder -> innerJoin ( $ join -> getJoin ( ) ? : $ entity , $ this -> encodeAlias ( $ entity ) , $ join -> getJoinConditionMethod ( ) , $ join -> getJoinCondition ( ) ) ; break ; } } }
Adds joins to querybuilder.

@param QueryBuilder $queryBuilder
@param array $joins
Adds joins to querybuilder .