src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php
public static function addJoinOnce(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $association, string $joinType = null, string $conditionType = null, string $condition = null, string $originAlias = null): string
    {
        $join = self::getExistingJoin($queryBuilder, $alias, $association, $originAlias);

        if (null !== $join) {
            return $join->getAlias();
        }

        $associationAlias = $queryNameGenerator->generateJoinAlias($association);
        $query = "$alias.$association";

        if (Join::LEFT_JOIN === $joinType || QueryChecker::hasLeftJoin($queryBuilder)) {
            $queryBuilder->leftJoin($query, $associationAlias, $conditionType, $condition);
        } else {
            $queryBuilder->innerJoin($query, $associationAlias, $conditionType, $condition);
        }

        return $associationAlias;
    }
public static function addJoinOnce(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $alias, string $association, string $joinType = null, string $conditionType = null, string $condition = null, string $originAlias = null): string
    {
        $join = self::getExistingJoin($queryBuilder, $alias, $association, $originAlias);

        if (null !== $join) {
            return $join->getAlias();
        }

        $associationAlias = $queryNameGenerator->generateJoinAlias($association);
        $query = "$alias.$association";

        if (Join::LEFT_JOIN === $joinType || QueryChecker::hasLeftJoin($queryBuilder)) {
            $queryBuilder->leftJoin($query, $associationAlias, $conditionType, $condition);
        } else {
            $queryBuilder->innerJoin($query, $associationAlias, $conditionType, $condition);
        }

        return $associationAlias;
    }
public static function addJoinOnce ( QueryBuilder $ queryBuilder , QueryNameGeneratorInterface $ queryNameGenerator , string $ alias , string $ association , string $ joinType = null , string $ conditionType = null , string $ condition = null , string $ originAlias = null ) : string { $ join = self :: getExistingJoin ( $ queryBuilder , $ alias , $ association , $ originAlias ) ; if ( null !== $ join ) { return $ join -> getAlias ( ) ; } $ associationAlias = $ queryNameGenerator -> generateJoinAlias ( $ association ) ; $ query = "$alias.$association" ; if ( Join :: LEFT_JOIN === $ joinType || QueryChecker :: hasLeftJoin ( $ queryBuilder ) ) { $ queryBuilder -> leftJoin ( $ query , $ associationAlias , $ conditionType , $ condition ) ; } else { $ queryBuilder -> innerJoin ( $ query , $ associationAlias , $ conditionType , $ condition ) ; } return $ associationAlias ; }
Adds a join to the QueryBuilder if none exists.
Adds a join to the QueryBuilder if none exists .