Entity/EntityRepository.php
protected function hasJoin(QueryBuilder $queryBuilder, $joinString)
    {
        /* @var \Doctrine\ORM\Query\Expr\Join $joinExpression */
        foreach ($queryBuilder->getDQLPart('join') as $joinsList) {
            foreach ($joinsList as $joinExpression) {
                if ($joinExpression->getJoin() == $joinString) {
                    return true;
                }
            }
        }

        return false;
    }
protected function hasJoin(QueryBuilder $queryBuilder, $joinString)
    {
        /* @var \Doctrine\ORM\Query\Expr\Join $joinExpression */
        foreach ($queryBuilder->getDQLPart('join') as $joinsList) {
            foreach ($joinsList as $joinExpression) {
                if ($joinExpression->getJoin() == $joinString) {
                    return true;
                }
            }
        }

        return false;
    }
protected function hasJoin ( QueryBuilder $ queryBuilder , $ joinString ) { /* @var \Doctrine\ORM\Query\Expr\Join $joinExpression */ foreach ( $ queryBuilder -> getDQLPart ( 'join' ) as $ joinsList ) { foreach ( $ joinsList as $ joinExpression ) { if ( $ joinExpression -> getJoin ( ) == $ joinString ) { return true ; } } } return false ; }
Returns TRUE if the join string is already present inside the query builder, FALSE otherwise.

@param \Doctrine\ORM\QueryBuilder $queryBuilder
@param string $joinString
@return boolean
Returns TRUE if the join string is already present inside the query builder FALSE otherwise .