protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->asfSimpleForumForum !== null) { if ($this->asfSimpleForumForum->isModified()) { $affectedRows += $this->asfSimpleForumForum->save($con); } $this->setsfSimpleForumForum($this->asfSimpleForumForum); } if ($this->asfSimpleForumPost !== null) { if ($this->asfSimpleForumPost->isModified()) { $affectedRows += $this->asfSimpleForumPost->save($con); } $this->setsfSimpleForumPost($this->asfSimpleForumPost); } if ($this->asfGuardUser !== null) { if ($this->asfGuardUser->isModified()) { $affectedRows += $this->asfGuardUser->save($con); } $this->setsfGuardUser($this->asfGuardUser); } if ($this->isModified()) { if ($this->isNew()) { $pk = sfSimpleForumTopicPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += sfSimpleForumTopicPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collsfSimpleForumPosts !== null) { foreach ($this->collsfSimpleForumPosts as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collsfSimpleForumTopicViews !== null) { foreach ($this->collsfSimpleForumTopicViews as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }