예제 #1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aScoreRule !== null) {
             if ($this->aScoreRule->isModified()) {
                 $affectedRows += $this->aScoreRule->save($con);
             }
             $this->setScoreRule($this->aScoreRule);
         }
         if ($this->aSubjectCurr !== null) {
             if ($this->aSubjectCurr->isModified()) {
                 $affectedRows += $this->aSubjectCurr->save($con);
             }
             $this->setSubjectCurr($this->aSubjectCurr);
         }
         if ($this->aScoreRuleSubjectRelatedByParent !== null) {
             if ($this->aScoreRuleSubjectRelatedByParent->isModified()) {
                 $affectedRows += $this->aScoreRuleSubjectRelatedByParent->save($con);
             }
             $this->setScoreRuleSubjectRelatedByParent($this->aScoreRuleSubjectRelatedByParent);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = ScoreRuleSubjectPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += ScoreRuleSubjectPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collScoreRuleSubjectsRelatedByParent !== null) {
             foreach ($this->collScoreRuleSubjectsRelatedByParent as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }