protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aNgTestSchedule !== null) { if ($this->aNgTestSchedule->isModified()) { $affectedRows += $this->aNgTestSchedule->save($con); } $this->setNgTestSchedule($this->aNgTestSchedule); } if ($this->aNgTestApplicant !== null) { if ($this->aNgTestApplicant->isModified()) { $affectedRows += $this->aNgTestApplicant->save($con); } $this->setNgTestApplicant($this->aNgTestApplicant); } if ($this->isModified()) { if ($this->isNew()) { $pk = NgTestApplSchedPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += NgTestApplSchedPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collNgTestApplScores !== null) { foreach ($this->collNgTestApplScores as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }