/** * Returns an instance of class (singleton pattern implementation). * * @return BOL_GeolocationCountryDao */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
public function updateCountryNameListToLanguage($languageId) { if (!$this->isServiceAvailable()) { return; } $countryList = $this->countryDao->findAll(); /* @var $country BOL_GeolocationCountry */ foreach ($countryList as $country) { $key = BOL_LanguageService::getInstance()->findKey('base', 'geolocation_country_name_' . $country->cc3); if ($key !== null) { $value = BOL_LanguageService::getInstance()->findValue($languageId, $key->id); if ($value !== null) { $value->value = ucwords(strtolower($country->name)); BOL_LanguageService::getInstance()->saveValue($value, false); } } } }