Пример #1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aEmployee !== null) {
             if ($this->aEmployee->isModified()) {
                 $affectedRows += $this->aEmployee->save($con);
             }
             $this->setEmployee($this->aEmployee);
         }
         if ($this->aStudentRelatedByStudentInformer !== null) {
             if ($this->aStudentRelatedByStudentInformer->isModified()) {
                 $affectedRows += $this->aStudentRelatedByStudentInformer->save($con);
             }
             $this->setStudentRelatedByStudentInformer($this->aStudentRelatedByStudentInformer);
         }
         if ($this->aLocation !== null) {
             if ($this->aLocation->isModified()) {
                 $affectedRows += $this->aLocation->save($con);
             }
             $this->setLocation($this->aLocation);
         }
         if ($this->aStudentRelatedByStudentId !== null) {
             if ($this->aStudentRelatedByStudentId->isModified()) {
                 $affectedRows += $this->aStudentRelatedByStudentId->save($con);
             }
             $this->setStudentRelatedByStudentId($this->aStudentRelatedByStudentId);
         }
         if ($this->aCounselingStatus !== null) {
             if ($this->aCounselingStatus->isModified()) {
                 $affectedRows += $this->aCounselingStatus->save($con);
             }
             $this->setCounselingStatus($this->aCounselingStatus);
         }
         if ($this->aClassGroup !== null) {
             if ($this->aClassGroup->isModified()) {
                 $affectedRows += $this->aClassGroup->save($con);
             }
             $this->setClassGroup($this->aClassGroup);
         }
         if ($this->aAcademicCalendar !== null) {
             if ($this->aAcademicCalendar->isModified()) {
                 $affectedRows += $this->aAcademicCalendar->save($con);
             }
             $this->setAcademicCalendar($this->aAcademicCalendar);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = OutclassCounselingPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += OutclassCounselingPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }