示例#1
0
 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->aReligion !== null) {
             if ($this->aReligion->isModified()) {
                 $affectedRows += $this->aReligion->save($con);
             }
             $this->setReligion($this->aReligion);
         }
         if ($this->aCountryRelatedByCountryId !== null) {
             if ($this->aCountryRelatedByCountryId->isModified()) {
                 $affectedRows += $this->aCountryRelatedByCountryId->save($con);
             }
             $this->setCountryRelatedByCountryId($this->aCountryRelatedByCountryId);
         }
         if ($this->aCountryRelatedByNationality !== null) {
             if ($this->aCountryRelatedByNationality->isModified()) {
                 $affectedRows += $this->aCountryRelatedByNationality->save($con);
             }
             $this->setCountryRelatedByNationality($this->aCountryRelatedByNationality);
         }
         if ($this->aDegree !== null) {
             if ($this->aDegree->isModified()) {
                 $affectedRows += $this->aDegree->save($con);
             }
             $this->setDegree($this->aDegree);
         }
         if ($this->aRegion !== null) {
             if ($this->aRegion->isModified()) {
                 $affectedRows += $this->aRegion->save($con);
             }
             $this->setRegion($this->aRegion);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = StudentParentsPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += StudentParentsPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }