protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aStudent !== null) { if ($this->aStudent->isModified()) { $affectedRows += $this->aStudent->save($con); } $this->setStudent($this->aStudent); } if ($this->aAcademicCalendar !== null) { if ($this->aAcademicCalendar->isModified()) { $affectedRows += $this->aAcademicCalendar->save($con); } $this->setAcademicCalendar($this->aAcademicCalendar); } if ($this->aClassGroup !== null) { if ($this->aClassGroup->isModified()) { $affectedRows += $this->aClassGroup->save($con); } $this->setClassGroup($this->aClassGroup); } if ($this->isModified()) { if ($this->isNew()) { $pk = StudentAccalPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += StudentAccalPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collVScoreExamA1as !== null) { foreach ($this->collVScoreExamA1as as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVScoreExamB1as !== null) { foreach ($this->collVScoreExamB1as as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVScoreFinalA1as !== null) { foreach ($this->collVScoreFinalA1as as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVScoreFinalB1as !== null) { foreach ($this->collVScoreFinalB1as as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVScoreTgsA1as !== null) { foreach ($this->collVScoreTgsA1as as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVScoreTgsB1as !== null) { foreach ($this->collVScoreTgsB1as as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVScoreUhA1as !== null) { foreach ($this->collVScoreUhA1as as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVScoreUhB1as !== null) { foreach ($this->collVScoreUhB1as as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVStudentRaports !== null) { foreach ($this->collVStudentRaports as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }