Ejemplo n.º 1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->asfSimpleForumTopic !== null) {
             if ($this->asfSimpleForumTopic->isModified()) {
                 $affectedRows += $this->asfSimpleForumTopic->save($con);
             }
             $this->setsfSimpleForumTopic($this->asfSimpleForumTopic);
         }
         if ($this->asfGuardUser !== null) {
             if ($this->asfGuardUser->isModified()) {
                 $affectedRows += $this->asfGuardUser->save($con);
             }
             $this->setsfGuardUser($this->asfGuardUser);
         }
         if ($this->asfSimpleForumForum !== null) {
             if ($this->asfSimpleForumForum->isModified()) {
                 $affectedRows += $this->asfSimpleForumForum->save($con);
             }
             $this->setsfSimpleForumForum($this->asfSimpleForumForum);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = sfSimpleForumPostPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += sfSimpleForumPostPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collsfSimpleForumTopics !== null) {
             foreach ($this->collsfSimpleForumTopics as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collsfSimpleForumForums !== null) {
             foreach ($this->collsfSimpleForumForums as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }