I have an entity that looks like this:
class Category extends BaseCategory { protected $children; protected $parent; }
and I'm trying to run a query like this:
$qb = $this->em->createQueryBuilder() ->select('c.parent') ->from('Category', 'c'); $result = $qb->getQuery()->getArrayResult();
However, I get the following error:
[Semantical Error] ... Error: Invalid PathExpression. Must be a StateFieldPathExpression.
How to select parent_id field from my table. I tried a bunch of variations, and even if I do something like this:
$qb = $this->em->createQueryBuilder() ->select('c') ->from('Category', 'c');
I get all the fields in the table except for parent_id. The Doctrine seems to interfere. How can I request this parent_id field? or better yet, how can I get all the fields in the table, including parent_id
symfony doctrine2 dql
Mike Jan 08 '13 at 13:54
source share