Example #1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aCurriculum !== null) {
             if ($this->aCurriculum->isModified()) {
                 $affectedRows += $this->aCurriculum->save($con);
             }
             $this->setCurriculum($this->aCurriculum);
         }
         if ($this->aAcademicCalendar !== null) {
             if ($this->aAcademicCalendar->isModified()) {
                 $affectedRows += $this->aAcademicCalendar->save($con);
             }
             $this->setAcademicCalendar($this->aAcademicCalendar);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = RegPeriodPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += RegPeriodPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collRegTestPeriods !== null) {
             foreach ($this->collRegTestPeriods as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }