3
Symfony2和主义-错误:无效的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] ... …