示例#1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aSubjectAccal !== null) {
             if ($this->aSubjectAccal->isModified()) {
                 $affectedRows += $this->aSubjectAccal->save($con);
             }
             $this->setSubjectAccal($this->aSubjectAccal);
         }
         if ($this->aSubjectCurr !== null) {
             if ($this->aSubjectCurr->isModified()) {
                 $affectedRows += $this->aSubjectCurr->save($con);
             }
             $this->setSubjectCurr($this->aSubjectCurr);
         }
         if ($this->aGradeComponent !== null) {
             if ($this->aGradeComponent->isModified()) {
                 $affectedRows += $this->aGradeComponent->save($con);
             }
             $this->setGradeComponent($this->aGradeComponent);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = SubjectGradingPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += SubjectGradingPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collClassAgendas !== null) {
             foreach ($this->collClassAgendas as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collSubjectCompetencys !== null) {
             foreach ($this->collSubjectCompetencys as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }