protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aTestApplicantDetail !== null) { if ($this->aTestApplicantDetail->isModified()) { $affectedRows += $this->aTestApplicantDetail->save($con); } $this->setTestApplicantDetail($this->aTestApplicantDetail); } if ($this->aDepartmentRelatedByDepartment1 !== null) { if ($this->aDepartmentRelatedByDepartment1->isModified()) { $affectedRows += $this->aDepartmentRelatedByDepartment1->save($con); } $this->setDepartmentRelatedByDepartment1($this->aDepartmentRelatedByDepartment1); } if ($this->aClassGroupRelatedByClassGroup1 !== null) { if ($this->aClassGroupRelatedByClassGroup1->isModified()) { $affectedRows += $this->aClassGroupRelatedByClassGroup1->save($con); } $this->setClassGroupRelatedByClassGroup1($this->aClassGroupRelatedByClassGroup1); } if ($this->aRegTestPeriodRelatedByRegTestPeriod1 !== null) { if ($this->aRegTestPeriodRelatedByRegTestPeriod1->isModified()) { $affectedRows += $this->aRegTestPeriodRelatedByRegTestPeriod1->save($con); } $this->setRegTestPeriodRelatedByRegTestPeriod1($this->aRegTestPeriodRelatedByRegTestPeriod1); } if ($this->aLocationRelatedByLocation1 !== null) { if ($this->aLocationRelatedByLocation1->isModified()) { $affectedRows += $this->aLocationRelatedByLocation1->save($con); } $this->setLocationRelatedByLocation1($this->aLocationRelatedByLocation1); } if ($this->aDepartmentRelatedByDepartment2 !== null) { if ($this->aDepartmentRelatedByDepartment2->isModified()) { $affectedRows += $this->aDepartmentRelatedByDepartment2->save($con); } $this->setDepartmentRelatedByDepartment2($this->aDepartmentRelatedByDepartment2); } if ($this->aClassGroupRelatedByClassGroup2 !== null) { if ($this->aClassGroupRelatedByClassGroup2->isModified()) { $affectedRows += $this->aClassGroupRelatedByClassGroup2->save($con); } $this->setClassGroupRelatedByClassGroup2($this->aClassGroupRelatedByClassGroup2); } if ($this->aRegTestPeriodRelatedByRegTestPeriod2 !== null) { if ($this->aRegTestPeriodRelatedByRegTestPeriod2->isModified()) { $affectedRows += $this->aRegTestPeriodRelatedByRegTestPeriod2->save($con); } $this->setRegTestPeriodRelatedByRegTestPeriod2($this->aRegTestPeriodRelatedByRegTestPeriod2); } if ($this->aLocationRelatedByLocation2 !== null) { if ($this->aLocationRelatedByLocation2->isModified()) { $affectedRows += $this->aLocationRelatedByLocation2->save($con); } $this->setLocationRelatedByLocation2($this->aLocationRelatedByLocation2); } if ($this->isModified()) { if ($this->isNew()) { $pk = TestApplicantPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += TestApplicantPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collTestApplicantPhotos !== null) { foreach ($this->collTestApplicantPhotos as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collTestApplicantFiles !== null) { foreach ($this->collTestApplicantFiles as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collTestGrades !== null) { foreach ($this->collTestGrades as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collTestScores !== null) { foreach ($this->collTestScores as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collTestApplScheds !== null) { foreach ($this->collTestApplScheds as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVTestApplScheds !== null) { foreach ($this->collVTestApplScheds as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collStudents !== null) { foreach ($this->collStudents as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVStudentActives !== null) { foreach ($this->collVStudentActives as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVStudentLogins !== null) { foreach ($this->collVStudentLogins as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVStudents !== null) { foreach ($this->collVStudents as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collSubjectTransfers !== null) { foreach ($this->collSubjectTransfers as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collPaymentApplicants !== null) { foreach ($this->collPaymentApplicants as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }