This chapter shows you how to accomplish bulk inserts, updates and deletes with Doctrine in an efficient way. The main problem with bulk operations is usually not to run out of memory and this is especially what the strategies presented here provide help with.
It turns out the solution is really simple. We just need to tell Doctrine of our intentions to fetch just part of the entity, by using the partial DQL keyword. SELECT partial l{id, title} FROM Log l Word of warning though: Doctrine will not lazily fetch the omitted fields, like it does for associations. If ...
DQL stands for Doctrine Query Language and is an Object Query Language derivate that is very similar to the Hibernate Query Language (HQL) or the Java Persistence Query Language (JPQL).
We’ve done a lot of work so its time to see one of the most powerful features of Doctrine: events. Using an ORM gives us the flexibility to have hooks that are executed whenever certain things are done, like when an entity is first persisted to the database, updated, or deleted.