Can't u use saveAll() ?

Transactions are default when using this method.

best regards...


On Jan 9, 12:47 pm, Henrik Gemal <henrikge...@gmail.com> wrote:
> I have a function in a model which contains multiple save operations
> also in different models.
>
> So my function in model x does something like:
>
> x->save()
> y->save()
> z->save()
>
> so it's only if all of the saves success that I want to commit.
>
> But can I do something like:
>
> x->begin()
>  x->save()
>  y->save()
>  z->save()
> if  (all ok)
>  x->commit()
> else
>  x->rollback()
>
> ????
>
> Will that rollback all of the changes done in all models?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to