Ejemplo n.º 1
0
 /**
  * Set the user location by country short tag
  * 
  * @param string $strCountryShort
  * @throws Exception If short country is unknown 
  */
 public function setUserGeolocationByShortCountries($strCountriesShort)
 {
     // Clean up
     $this->objUserGeolocation->cleanAllCountries();
     $arrCountriesKeys = array_keys($this->getCountries());
     // Add new countries
     foreach ($strCountriesShort as $value) {
         if (in_array($value, $arrCountriesKeys)) {
             $this->objUserGeolocation->setCountryShort($value);
         }
     }
     // Set meta informations
     $this->objUserGeolocation->setTrackRunning(GeolocationContainer::LOCATION_NONE);
     $this->objUserGeolocation->setTracked(true);
     $this->objUserGeolocation->setTrackType(GeolocationContainer::LOCATION_BY_USER);
     $this->objUserGeolocation->setFailed(false);
     $this->objUserGeolocation->setError("");
     $this->objUserGeolocation->setErrorID(GeolocationContainer::ERROR_NONE);
     // Save in session
     $this->saveSession();
     $this->saveCookie();
 }