protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aFacility !== null) { if ($this->aFacility->isModified()) { $affectedRows += $this->aFacility->save($con); } $this->setFacility($this->aFacility); } if ($this->aLocation !== null) { if ($this->aLocation->isModified()) { $affectedRows += $this->aLocation->save($con); } $this->setLocation($this->aLocation); } if ($this->aAcademicCalendar !== null) { if ($this->aAcademicCalendar->isModified()) { $affectedRows += $this->aAcademicCalendar->save($con); } $this->setAcademicCalendar($this->aAcademicCalendar); } if ($this->isModified()) { if ($this->isNew()) { $pk = FacilityLocationPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += FacilityLocationPeer::doUpdate($this, $con); } $this->resetModified(); } $this->alreadyInSave = false; } return $affectedRows; }