Exemplo n.º 1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aClassGroupRelatedByParent !== null) {
             if ($this->aClassGroupRelatedByParent->isModified()) {
                 $affectedRows += $this->aClassGroupRelatedByParent->save($con);
             }
             $this->setClassGroupRelatedByParent($this->aClassGroupRelatedByParent);
         }
         if ($this->aDepartment !== null) {
             if ($this->aDepartment->isModified()) {
                 $affectedRows += $this->aDepartment->save($con);
             }
             $this->setDepartment($this->aDepartment);
         }
         if ($this->aClassLevel !== null) {
             if ($this->aClassLevel->isModified()) {
                 $affectedRows += $this->aClassLevel->save($con);
             }
             $this->setClassLevel($this->aClassLevel);
         }
         if ($this->aClassType !== null) {
             if ($this->aClassType->isModified()) {
                 $affectedRows += $this->aClassType->save($con);
             }
             $this->setClassType($this->aClassType);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = ClassGroupPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += ClassGroupPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collStudentAchievements !== null) {
             foreach ($this->collStudentAchievements as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudentDescs !== null) {
             foreach ($this->collStudentDescs as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudentAbsenceRecapts !== null) {
             foreach ($this->collStudentAbsenceRecapts as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collClassAbsences !== null) {
             foreach ($this->collClassAbsences as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudentSubjects !== null) {
             foreach ($this->collStudentSubjects as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudentSubjectGroups !== null) {
             foreach ($this->collStudentSubjectGroups as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collClassGroupsRelatedByParent !== null) {
             foreach ($this->collClassGroupsRelatedByParent as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collAcademicCalendars !== null) {
             foreach ($this->collAcademicCalendars as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVAcademicCalendars !== null) {
             foreach ($this->collVAcademicCalendars as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collTestApplicantsRelatedByClassGroup1 !== null) {
             foreach ($this->collTestApplicantsRelatedByClassGroup1 as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collTestApplicantsRelatedByClassGroup2 !== null) {
             foreach ($this->collTestApplicantsRelatedByClassGroup2 as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVReturns !== null) {
             foreach ($this->collVReturns as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collTestApplicantSiblings !== null) {
             foreach ($this->collTestApplicantSiblings as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudents !== null) {
             foreach ($this->collStudents as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVStudents !== null) {
             foreach ($this->collVStudents as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collCourseSchedules !== null) {
             foreach ($this->collCourseSchedules as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVCourseSessions !== null) {
             foreach ($this->collVCourseSessions as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collCounselings !== null) {
             foreach ($this->collCounselings as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVCounselings !== null) {
             foreach ($this->collVCounselings as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudentCourses !== null) {
             foreach ($this->collStudentCourses as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collCourseRegulations !== null) {
             foreach ($this->collCourseRegulations as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudentRaports !== null) {
             foreach ($this->collStudentRaports as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudentFinals !== null) {
             foreach ($this->collStudentFinals as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collScoreRules !== null) {
             foreach ($this->collScoreRules as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collSubjectGradings !== null) {
             foreach ($this->collSubjectGradings as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collSubjectRules !== null) {
             foreach ($this->collSubjectRules as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collSubjectCompetencyRules !== null) {
             foreach ($this->collSubjectCompetencyRules as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudentMedicals !== null) {
             foreach ($this->collStudentMedicals as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudentSiblingss !== null) {
             foreach ($this->collStudentSiblingss as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collStudentPersonalitys !== null) {
             foreach ($this->collStudentPersonalitys as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVSubjectAccalLectorStudents !== null) {
             foreach ($this->collVSubjectAccalLectorStudents as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVSubjectAccalLectorStudentDetails !== null) {
             foreach ($this->collVSubjectAccalLectorStudentDetails as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }