protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aStudent !== null) { if ($this->aStudent->isModified()) { $affectedRows += $this->aStudent->save($con); } $this->setStudent($this->aStudent); } if ($this->aTalent !== null) { if ($this->aTalent->isModified()) { $affectedRows += $this->aTalent->save($con); } $this->setTalent($this->aTalent); } if ($this->isModified()) { if ($this->isNew()) { $pk = StudentAchievementPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += StudentAchievementPeer::doUpdate($this, $con); } $this->resetModified(); } $this->alreadyInSave = false; } return $affectedRows; }