protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aEmployee !== null) { if ($this->aEmployee->isModified()) { $affectedRows += $this->aEmployee->save($con); } $this->setEmployee($this->aEmployee); } 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->aStaffType !== null) { if ($this->aStaffType->isModified()) { $affectedRows += $this->aStaffType->save($con); } $this->setStaffType($this->aStaffType); } if ($this->aEmployeeLevel !== null) { if ($this->aEmployeeLevel->isModified()) { $affectedRows += $this->aEmployeeLevel->save($con); } $this->setEmployeeLevel($this->aEmployeeLevel); } if ($this->aIllness !== null) { if ($this->aIllness->isModified()) { $affectedRows += $this->aIllness->save($con); } $this->setIllness($this->aIllness); } if ($this->isModified()) { if ($this->isNew()) { $pk = EmployeeMedicalPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += EmployeeMedicalPeer::doUpdate($this, $con); } $this->resetModified(); } $this->alreadyInSave = false; } return $affectedRows; }