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