private function applyJoins(ClassMetadata $metadata, array $joins, string $alias): void
    {
        foreach ($joins as $field => $join) {
            $joinedAlias = $this->createJoin($alias, $field, $join['type']);

            if (isset($join['joins']) || isset($join['conditions'])) {
                $targetClassName = $metadata->getAssociationMapping($field)['targetEntity'];
                $targetMetadata = $this->entityManager->getClassMetadata($targetClassName);
                $type = $this->types->getFilterGroupCondition($targetClassName);
                $this->applyJoinsAndFilters($targetMetadata, $joinedAlias, $type, $join['joins'] ?? [], $join['conditions'] ?? []);
            }
        }
    }
private function applyJoins(ClassMetadata $metadata, array $joins, string $alias): void
    {
        foreach ($joins as $field => $join) {
            $joinedAlias = $this->createJoin($alias, $field, $join['type']);

            if (isset($join['joins']) || isset($join['conditions'])) {
                $targetClassName = $metadata->getAssociationMapping($field)['targetEntity'];
                $targetMetadata = $this->entityManager->getClassMetadata($targetClassName);
                $type = $this->types->getFilterGroupCondition($targetClassName);
                $this->applyJoinsAndFilters($targetMetadata, $joinedAlias, $type, $join['joins'] ?? [], $join['conditions'] ?? []);
            }
        }
    }
private function applyJoins ( ClassMetadata $ metadata , array $ joins , string $ alias ) : void { foreach ( $ joins as $ field => $ join ) { $ joinedAlias = $ this -> createJoin ( $ alias , $ field , $ join [ 'type' ] ) ; if ( isset ( $ join [ 'joins' ] ) || isset ( $ join [ 'conditions' ] ) ) { $ targetClassName = $ metadata -> getAssociationMapping ( $ field ) [ 'targetEntity' ] ; $ targetMetadata = $ this -> entityManager -> getClassMetadata ( $ targetClassName ) ; $ type = $ this -> types -> getFilterGroupCondition ( $ targetClassName ) ; $ this -> applyJoinsAndFilters ( $ targetMetadata , $ joinedAlias , $ type , $ join [ 'joins' ] ?? [ ] , $ join [ 'conditions' ] ?? [ ] ) ; } } }
Apply joins to the query builder

@param ClassMetadata $metadata
@param array $joins
@param string $alias

@throws \Doctrine\ORM\Mapping\MappingException
Apply joins to the query builder