protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aRegionRelatedByParent !== null) { if ($this->aRegionRelatedByParent->isModified()) { $affectedRows += $this->aRegionRelatedByParent->save($con); } $this->setRegionRelatedByParent($this->aRegionRelatedByParent); } if ($this->isModified()) { if ($this->isNew()) { $pk = RegionPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += RegionPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collRegionsRelatedByParent !== null) { foreach ($this->collRegionsRelatedByParent as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collStudentDetails !== null) { foreach ($this->collStudentDetails as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collTestApplicantDetails !== null) { foreach ($this->collTestApplicantDetails as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collStudentParentssRelatedByPob !== null) { foreach ($this->collStudentParentssRelatedByPob as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collStudentParentssRelatedByRegionId !== null) { foreach ($this->collStudentParentssRelatedByRegionId as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }