示例#1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->asfPoll !== null) {
             if ($this->asfPoll->isModified()) {
                 $affectedRows += $this->asfPoll->save($con);
             }
             $this->setsfPoll($this->asfPoll);
         }
         if ($this->asfPollAnswer !== null) {
             if ($this->asfPollAnswer->isModified()) {
                 $affectedRows += $this->asfPollAnswer->save($con);
             }
             $this->setsfPollAnswer($this->asfPollAnswer);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = sfPollUserAnswerPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += sfPollUserAnswerPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }