if I have more than 2 models A, B, and C, do i need to do a
$this->[model]->begin() for all of the models, or just the first model?

for example, do I need to do this:

$this->A->begin()
$this->B->begin()
.....
if ($this->A->save(...))
{
    if ($this->B->save(...))
    {
          if ($this->C->save(...))
          {
                $this->A->commit();
                $this->B->commit();
          }
          else
          {
               $this->A->rollback();
               $this->B->rollback();
          }
    }
}

Or, can I just do this?

$this->A->begin()
.....
if ($this->A->save(...))
{
    if ($this->B->save(...))
    {
          if ($this->C->save(...))
          {
                $this->A->commit();
          }
          else
          {
               $this->A->rollback();
          }
    }
}

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

Reply via email to