Example #1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aCourseSchedule !== null) {
             if ($this->aCourseSchedule->isModified()) {
                 $affectedRows += $this->aCourseSchedule->save($con);
             }
             $this->setCourseSchedule($this->aCourseSchedule);
         }
         if ($this->aSubjectCurr !== null) {
             if ($this->aSubjectCurr->isModified()) {
                 $affectedRows += $this->aSubjectCurr->save($con);
             }
             $this->setSubjectCurr($this->aSubjectCurr);
         }
         if ($this->aEmployee !== null) {
             if ($this->aEmployee->isModified()) {
                 $affectedRows += $this->aEmployee->save($con);
             }
             $this->setEmployee($this->aEmployee);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = VAbsenceCoursePeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setNew(false);
             } else {
                 $affectedRows += VAbsenceCoursePeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }