4

I have a Doctrine Query object returned by a service. Then I need to add some "wheres, order by and Limit" parts. Is posible convert a QUery Object to QueryBuilder Object? How I do it?

4

1 回答 1

11

You cannot convert a query object to a query builder. Once you have a query object, you can use:

$query->getDQL();

to retrieve the DQL for that query object, and once you manipulated it (it's a string, so it is up to you)

$query->setDQL($modifiedDql);
于 2013-02-24T01:07:08.567 回答