protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aStudentAccal !== null) {
             if ($this->aStudentAccal->isModified()) {
                 $affectedRows += $this->aStudentAccal->save($con);
             }
             $this->setStudentAccal($this->aStudentAccal);
         }
         if ($this->aCourseSchedule !== null) {
             if ($this->aCourseSchedule->isModified()) {
                 $affectedRows += $this->aCourseSchedule->save($con);
             }
             $this->setCourseSchedule($this->aCourseSchedule);
         }
         if ($this->aSubjectCurr !== null) {
             if ($this->aSubjectCurr->isModified()) {
                 $affectedRows += $this->aSubjectCurr->save($con);
             }
             $this->setSubjectCurr($this->aSubjectCurr);
         }
         if ($this->aGradeSpec !== null) {
             if ($this->aGradeSpec->isModified()) {
                 $affectedRows += $this->aGradeSpec->save($con);
             }
             $this->setGradeSpec($this->aGradeSpec);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = StudentGradeRaportPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += StudentGradeRaportPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }