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->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->isModified()) { if ($this->isNew()) { $pk = CourseScheduleDetailPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += CourseScheduleDetailPeer::doUpdate($this, $con); } $this->resetModified(); } $this->alreadyInSave = false; } return $affectedRows; }