src/Bridge/Doctrine/Orm/Util/QueryBuilderHelper.php
private static function getExistingJoin(QueryBuilder $queryBuilder, string $alias, string $association, string $originAlias = null): ?Join
    {
        $parts = $queryBuilder->getDQLPart('join');
        $rootAlias = $originAlias ?? $queryBuilder->getRootAliases()[0];

        if (!isset($parts[$rootAlias])) {
            return null;
        }

        foreach ($parts[$rootAlias] as $join) {
            /** @var Join $join */
            if (sprintf('%s.%s', $alias, $association) === $join->getJoin()) {
                return $join;
            }
        }

        return null;
    }
private static function getExistingJoin(QueryBuilder $queryBuilder, string $alias, string $association, string $originAlias = null): ?Join
    {
        $parts = $queryBuilder->getDQLPart('join');
        $rootAlias = $originAlias ?? $queryBuilder->getRootAliases()[0];

        if (!isset($parts[$rootAlias])) {
            return null;
        }

        foreach ($parts[$rootAlias] as $join) {
            /** @var Join $join */
            if (sprintf('%s.%s', $alias, $association) === $join->getJoin()) {
                return $join;
            }
        }

        return null;
    }
private static function getExistingJoin ( QueryBuilder $ queryBuilder , string $ alias , string $ association , string $ originAlias = null ) : ? Join { $ parts = $ queryBuilder -> getDQLPart ( 'join' ) ; $ rootAlias = $ originAlias ?? $ queryBuilder -> getRootAliases ( ) [ 0 ] ; if ( ! isset ( $ parts [ $ rootAlias ] ) ) { return null ; } foreach ( $ parts [ $ rootAlias ] as $ join ) { /** @var Join $join */ if ( sprintf ( '%s.%s' , $ alias , $ association ) === $ join -> getJoin ( ) ) { return $ join ; } } return null ; }
Gets the existing join from QueryBuilder DQL parts.
Gets the existing join from QueryBuilder DQL parts .