Esempio n. 1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aNgRegInfo !== null) {
             if ($this->aNgRegInfo->isModified()) {
                 $affectedRows += $this->aNgRegInfo->save($con);
             }
             $this->setNgRegInfo($this->aNgRegInfo);
         }
         if ($this->aDepartment !== null) {
             if ($this->aDepartment->isModified()) {
                 $affectedRows += $this->aDepartment->save($con);
             }
             $this->setDepartment($this->aDepartment);
         }
         if ($this->aClassLevelRelatedByClassLevelId !== null) {
             if ($this->aClassLevelRelatedByClassLevelId->isModified()) {
                 $affectedRows += $this->aClassLevelRelatedByClassLevelId->save($con);
             }
             $this->setClassLevelRelatedByClassLevelId($this->aClassLevelRelatedByClassLevelId);
         }
         if ($this->aNgRegTestPeriod !== null) {
             if ($this->aNgRegTestPeriod->isModified()) {
                 $affectedRows += $this->aNgRegTestPeriod->save($con);
             }
             $this->setNgRegTestPeriod($this->aNgRegTestPeriod);
         }
         if ($this->aNgStatusApplicant !== null) {
             if ($this->aNgStatusApplicant->isModified()) {
                 $affectedRows += $this->aNgStatusApplicant->save($con);
             }
             $this->setNgStatusApplicant($this->aNgStatusApplicant);
         }
         if ($this->aNgApplicantCategory !== null) {
             if ($this->aNgApplicantCategory->isModified()) {
                 $affectedRows += $this->aNgApplicantCategory->save($con);
             }
             $this->setNgApplicantCategory($this->aNgApplicantCategory);
         }
         if ($this->aCountry !== null) {
             if ($this->aCountry->isModified()) {
                 $affectedRows += $this->aCountry->save($con);
             }
             $this->setCountry($this->aCountry);
         }
         if ($this->aReligion !== null) {
             if ($this->aReligion->isModified()) {
                 $affectedRows += $this->aReligion->save($con);
             }
             $this->setReligion($this->aReligion);
         }
         if ($this->aRegion !== null) {
             if ($this->aRegion->isModified()) {
                 $affectedRows += $this->aRegion->save($con);
             }
             $this->setRegion($this->aRegion);
         }
         if ($this->aCity !== null) {
             if ($this->aCity->isModified()) {
                 $affectedRows += $this->aCity->save($con);
             }
             $this->setCity($this->aCity);
         }
         if ($this->aDistrict !== null) {
             if ($this->aDistrict->isModified()) {
                 $affectedRows += $this->aDistrict->save($con);
             }
             $this->setDistrict($this->aDistrict);
         }
         if ($this->aSubdistrict !== null) {
             if ($this->aSubdistrict->isModified()) {
                 $affectedRows += $this->aSubdistrict->save($con);
             }
             $this->setSubdistrict($this->aSubdistrict);
         }
         if ($this->aClassLevelRelatedByLastClass !== null) {
             if ($this->aClassLevelRelatedByLastClass->isModified()) {
                 $affectedRows += $this->aClassLevelRelatedByLastClass->save($con);
             }
             $this->setClassLevelRelatedByLastClass($this->aClassLevelRelatedByLastClass);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = NgTestApplicantPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += NgTestApplicantPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collNgTaMedicalRecords !== null) {
             foreach ($this->collNgTaMedicalRecords as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collNgTestApplicantParentss !== null) {
             foreach ($this->collNgTestApplicantParentss as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collNgTaAchievementRecords !== null) {
             foreach ($this->collNgTaAchievementRecords as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collNgTestApplScheds !== null) {
             foreach ($this->collNgTestApplScheds as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collNgTestApplPayments !== null) {
             foreach ($this->collNgTestApplPayments as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }