3

This is the query I am using:

$q = $this->getEntityManager()->createQueryBuilder("SELECT e FROM ActionModule\Action e JOIN e.type t WHERE t.id IN (:ids)");

I have tried every parameter assigning option:

  • :ids
  • ?1
  • implode(',', $ids)
  • ?ids

And always get:

Doctrine\ORM\Query\QueryException

[Syntax Error] line 0, col -1: Error: Expected IdentificationVariable | ScalarExpression | AggregateExpression | FunctionDeclaration | PartialObjectExpression | "(" Subselect ")" | CaseExpression, got end of string

Thanks a lot in advance

EDIT:

I've dumped $q->getQuery()->getDql() and got: "SELECT" (6)

0

1 Answer 1

4

createQueryBuilder doesn't accept any arguments and its purpose is creating queries using the builder methods, not DQL.

What you need is createQuery.

$q = $this->getEntityManager()->createQuery("SELECT e FROM ActionModule\Action e JOIN e.type t WHERE t.id IN (:ids)");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.