protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aSubjectAccal !== null) { if ($this->aSubjectAccal->isModified()) { $affectedRows += $this->aSubjectAccal->save($con); } $this->setSubjectAccal($this->aSubjectAccal); } 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->aClassGroup !== null) { if ($this->aClassGroup->isModified()) { $affectedRows += $this->aClassGroup->save($con); } $this->setClassGroup($this->aClassGroup); } if ($this->aLocation !== null) { if ($this->aLocation->isModified()) { $affectedRows += $this->aLocation->save($con); } $this->setLocation($this->aLocation); } if ($this->aClassSession !== null) { if ($this->aClassSession->isModified()) { $affectedRows += $this->aClassSession->save($con); } $this->setClassSession($this->aClassSession); } if ($this->aAcademicCalendar !== null) { if ($this->aAcademicCalendar->isModified()) { $affectedRows += $this->aAcademicCalendar->save($con); } $this->setAcademicCalendar($this->aAcademicCalendar); } if ($this->isModified()) { if ($this->isNew()) { $pk = CourseSchedulePeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += CourseSchedulePeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collCourseScheduleTutors !== null) { foreach ($this->collCourseScheduleTutors as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collCourseScheduleDetails !== null) { foreach ($this->collCourseScheduleDetails 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); } } } $this->alreadyInSave = false; } return $affectedRows; }