คำถามติดแท็ก dql

3
Symfony2 และ Doctrine - ข้อผิดพลาด: PathExpression ไม่ถูกต้อง ต้องเป็น StateFieldPathExpression
ฉันมีเอนทิตีที่มีลักษณะดังนี้: /** * @Gedmo\Tree(type="nested") * @ORM\Table(name="categories") * @ORM\Entity() */ class Category extends BaseCategory { /** * @ORM\OneToMany(targetEntity="Category", mappedBy="parent") */ protected $children; /** * @Gedmo\TreeParent * @ORM\ManyToOne(targetEntity="Category", inversedBy="children") * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL") */ protected $parent; } และฉันกำลังพยายามเรียกใช้แบบสอบถามเช่นนี้: $qb = $this->em->createQueryBuilder() ->select('c.parent') ->from('Category', 'c'); $result = $qb->getQuery()->getArrayResult(); อย่างไรก็ตามฉันได้รับข้อผิดพลาดต่อไปนี้: [Semantical Error] ... …
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.