protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aLocationCategory !== null) { if ($this->aLocationCategory->isModified()) { $affectedRows += $this->aLocationCategory->save($con); } $this->setLocationCategory($this->aLocationCategory); } if ($this->aLocationCondition !== null) { if ($this->aLocationCondition->isModified()) { $affectedRows += $this->aLocationCondition->save($con); } $this->setLocationCondition($this->aLocationCondition); } if ($this->aLocationRelatedByParent !== null) { if ($this->aLocationRelatedByParent->isModified()) { $affectedRows += $this->aLocationRelatedByParent->save($con); } $this->setLocationRelatedByParent($this->aLocationRelatedByParent); } if ($this->aDepartment !== null) { if ($this->aDepartment->isModified()) { $affectedRows += $this->aDepartment->save($con); } $this->setDepartment($this->aDepartment); } if ($this->aAcademicCalendar !== null) { if ($this->aAcademicCalendar->isModified()) { $affectedRows += $this->aAcademicCalendar->save($con); } $this->setAcademicCalendar($this->aAcademicCalendar); } if ($this->isModified()) { if ($this->isNew()) { $pk = LocationPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += LocationPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collLocationsRelatedByParent !== null) { foreach ($this->collLocationsRelatedByParent as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVLocations !== null) { foreach ($this->collVLocations as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collFacilityLocations !== null) { foreach ($this->collFacilityLocations as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collTestApplicantsRelatedByLocation1 !== null) { foreach ($this->collTestApplicantsRelatedByLocation1 as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collTestApplicantsRelatedByLocation2 !== null) { foreach ($this->collTestApplicantsRelatedByLocation2 as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collTestSchedules !== null) { foreach ($this->collTestSchedules as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVTestApplSchedsRelatedByLocation1 !== null) { foreach ($this->collVTestApplSchedsRelatedByLocation1 as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVTestApplSchedsRelatedByLocation2 !== null) { foreach ($this->collVTestApplSchedsRelatedByLocation2 as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVTestApplSched1s !== null) { foreach ($this->collVTestApplSched1s as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVTestApplSched2s !== null) { foreach ($this->collVTestApplSched2s as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVTestLocation1s !== null) { foreach ($this->collVTestLocation1s as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVTestLocation2s !== null) { foreach ($this->collVTestLocation2s 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->collCourseScheduleDetails !== null) { foreach ($this->collCourseScheduleDetails as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collVCourseSchedules !== null) { foreach ($this->collVCourseSchedules 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; }