I would like to do an update-query with a LIMIT like that:
UPDATE anytable SET anycolumn = 'anyvalue' WHERE anothercolumn='anothervalue' LIMIT 20
How is this possible with doctrine 2.1 ?
I would like to do an update-query with a LIMIT like that:
UPDATE anytable SET anycolumn = 'anyvalue' WHERE anothercolumn='anothervalue' LIMIT 20
How is this possible with doctrine 2.1 ?
I found I had to fetch the connection from the entityManager and call executeUpdate:
The doctrine page about native queries says:
Not doctrine specific, but maybe possible with a subquery ?
EDIT:
you can go about it in 2 different ways:
1 - Create query directly using DQL:
2 - Create query using QueryBuilder:
you should do: echo
$query->getSQL();
to check out the sql generated for these twoEDIT: another alternative (not highly recommended) is to use Native SQL