protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aStudentRelatedByStudentId !== null) { if ($this->aStudentRelatedByStudentId->isModified()) { $affectedRows += $this->aStudentRelatedByStudentId->save($con); } $this->setStudentRelatedByStudentId($this->aStudentRelatedByStudentId); } if ($this->aStudentRelatedByStudentRelated !== null) { if ($this->aStudentRelatedByStudentRelated->isModified()) { $affectedRows += $this->aStudentRelatedByStudentRelated->save($con); } $this->setStudentRelatedByStudentRelated($this->aStudentRelatedByStudentRelated); } if ($this->aDepartment !== null) { if ($this->aDepartment->isModified()) { $affectedRows += $this->aDepartment->save($con); } $this->setDepartment($this->aDepartment); } if ($this->aClassGroup !== null) { if ($this->aClassGroup->isModified()) { $affectedRows += $this->aClassGroup->save($con); } $this->setClassGroup($this->aClassGroup); } if ($this->isModified()) { if ($this->isNew()) { $pk = StudentSiblingPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += StudentSiblingPeer::doUpdate($this, $con); } $this->resetModified(); } $this->alreadyInSave = false; } return $affectedRows; }