mam tej kwerendy z podzapytania:Błąd podzapytaniu kreator zapytań doctrine2
$query = $this->getEntityManager()->createQueryBuilder();
$subquery = $query;
$subquery
->select('f.following')
->from('ApiBundle:Follow', 'f')
->where('f.follower = :follower_id')
->setParameter('follower_id', $id)
;
$query
->select('c')
->from('ApiBundle:Chef', 'c')
->where('c.id <> :id')
->setParameter('id', $id)
;
$query
->andWhere(
$query->expr()->notIn('c.id', $subquery->getDQL())
);
return $query->getQuery()->getResult();
i dostaję ten błąd:
[Semantical Error] line 0, col 116 near 'f, ApiBundle:Chef': Error: 'f' is already defined.
nie mogę znaleźć przyczynę błędu, alias f jest zdefiniowany tylko jeden raz. Jakieś sugestie?
Dziękuję bardzo, ale teraz błąd: [Błąd semantyczny] linia 0, col 74 w pobliżu "następujący FROM": Błąd: Niepoprawna PathExpression. Musi to być StateFieldPathExpression. – m4t1t0
@ m4t1t0 może to pomóc: http://stackoverflow.com/questions/14216470/symfony2-and-doctrine-error-invalid-pathexpress-must-be-a-statefieldpathe – cheesemacfly
Tak, to mi pomaga, dziękuję! – m4t1t0