Пример #1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aCur13Ki !== null) {
             if ($this->aCur13Ki->isModified()) {
                 $affectedRows += $this->aCur13Ki->save($con);
             }
             $this->setCur13Ki($this->aCur13Ki);
         }
         if ($this->aCourseSchedule !== null) {
             if ($this->aCourseSchedule->isModified()) {
                 $affectedRows += $this->aCourseSchedule->save($con);
             }
             $this->setCourseSchedule($this->aCourseSchedule);
         }
         if ($this->aGradeConversionTemplate !== null) {
             if ($this->aGradeConversionTemplate->isModified()) {
                 $affectedRows += $this->aGradeConversionTemplate->save($con);
             }
             $this->setGradeConversionTemplate($this->aGradeConversionTemplate);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = Cur13TermPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += Cur13TermPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collCur13TermSpecs !== null) {
             foreach ($this->collCur13TermSpecs as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collCur13GradeTerms !== null) {
             foreach ($this->collCur13GradeTerms as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }