Beispiel #1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aGradeSpecRelatedByParent !== null) {
             if ($this->aGradeSpecRelatedByParent->isModified()) {
                 $affectedRows += $this->aGradeSpecRelatedByParent->save($con);
             }
             $this->setGradeSpecRelatedByParent($this->aGradeSpecRelatedByParent);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = GradeSpecPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += GradeSpecPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collGradeSpecsRelatedByParent !== null) {
             foreach ($this->collGradeSpecsRelatedByParent as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collGradeComponents !== null) {
             foreach ($this->collGradeComponents as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVStudentScores !== null) {
             foreach ($this->collVStudentScores as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }