On Sunday, 9 March 2014 20:13:38 UTC+1, Parsifal wrote: > > Sorry i got confused. > So there is no need to persist at all and just flush outside foreach when > foreach is finished? I tought before every flush i need to use persist, so > please clarify what is the purpose of persist if i don't need to use it in > this case at all? >
Persist( ) is a bit confusing name for that method. Maybe it might better have been called manage( ), but that name is not very clear too. But what you do with persist( ) is making an entity managed, that is: all updates to it will be taken into account at the next flush( ). When you retrieve Entities via the Repository, using find( ), findBy( ) etc, they are allready managed. So: no need to call persist( ) for them. -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
