Reputation: 635
Is there any way to make update with criteria in Doctrine2 without using DQL and Native SQL? I mean only working with objects.
For example something like this:
$data = new Entities\Articles();
$data->setStatus("published");
/*
Add some criteria for update here
*/
$em->persist($data);
$em->flush();
What I want to do: Update multiple records without loading them from database.
Upvotes: 3
Views: 310
Reputation: 25431
No, Doctrine ORM does not currently support using the criteria API for updates. Criteria API is currently only available to fetch data, and still at a very early state.
If you can help us improve it, that would be awesome :)
The only currently available ways are through DQL and NativeSQL
Upvotes: 1