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