Ejemplo n.º 1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aRegion !== null) {
             if ($this->aRegion->isModified()) {
                 $affectedRows += $this->aRegion->save($con);
             }
             $this->setRegion($this->aRegion);
         }
         if ($this->aReligion !== null) {
             if ($this->aReligion->isModified()) {
                 $affectedRows += $this->aReligion->save($con);
             }
             $this->setReligion($this->aReligion);
         }
         if ($this->aAcademicCalendar !== null) {
             if ($this->aAcademicCalendar->isModified()) {
                 $affectedRows += $this->aAcademicCalendar->save($con);
             }
             $this->setAcademicCalendar($this->aAcademicCalendar);
         }
         if ($this->aCountry !== null) {
             if ($this->aCountry->isModified()) {
                 $affectedRows += $this->aCountry->save($con);
             }
             $this->setCountry($this->aCountry);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = TestApplicantDetailPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += TestApplicantDetailPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collTestApplicants !== null) {
             foreach ($this->collTestApplicants as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVApplicantTests !== null) {
             foreach ($this->collVApplicantTests as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }