It seems like `s.item` is an association value, and not a
StateFieldPathExpression.

You can learn more about the DQL grammar at
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#ebnf

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On 12 November 2014 10:16, Javier Garcia <[email protected]> wrote:

> Hi,
>
> Im trying to get all the rows of a table.
>
> At the begining I was using this:
>
>       $em = $this->getDoctrine()->getManager();
>       $query = $em->createQuery(
>         'SELECT s FROM Project\BackendBundle\Entity\Subitem s
>          WHERE s.item LIKE :item_id
>          ORDER BY s.' . $orderColumn . ' ' . $order
>       );
>       $query->setParameter('item_id', $itemId);
>
>
>
> but I get this error:
>
> [Semantical Error] line 0, col 70 near 'item LIKE :item_id
>> ': Error: Invalid PathExpression. Must be a StateFieldPathExpression.
>
>
>  Then I have change to this:
>
>       $em = $this->getDoctrine()->getManager();
>       $query = $em->createQuery(
>         'SELECT s FROM Project\BackendBundle\Entity\Subitem s
>          WHERE IDENTITY(s.item) LIKE :item_id
>          ORDER BY s.' . $orderColumn . ' ' . $order
>       );
>
>
>
> and it sees it is working ok (it returns all the rows), but why??
>
> --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to