Я пытаюсь соединить 2 запросов в DQL
, но я получаю сообщение об ошибке, которое говорит,Присоединение 2 Результаты в Учении бросает ошибку
[Semantical Error] line 0, col 114 near '(select u.email': Error: Class '(' is not defined.
Я прошел через https://stackoverflow.com/questions/24600439/error-in-nested-subquery-in-dql-class-is-not-defined. Но я не мог понять. Пожалуйста помоги. Мой запрос выглядит следующим образом:
$filterQuery = "SELECT tempResult1.email as email,tempResult1.name as name , tempResult1.id as user
FROM (select u.email as email,a.name as name , u.id as user
FROM
Application\Entity\Userhasrole uhr
INNER JOIN
Application\Entity\Oauthrole r with uhr.applicationrole = r.id
INNER JOIN
Application\Entity\Application a with r.application = a.id
INNER JOIN
Application\Entity\Oauthusers u
) tempResult1
LEFT JOIN
(SELECT uhr1.user as user FROM Application\Entity\Userhasrole uhr1 where
a.id = :applicationId
) tempResult2
with tempResult1.user = tempResult2.user";
$queryObject = $this->getEntityManager()
->createQuery($filterQuery);
$queryObject->setParameter('applicationId', $applicationId);
$result = $queryObject->getResult();