/** * @return Tx_Typo3Agencies_Domain_Model_Country */ public function getCountryObject() { if ($this->countryRepository == NULL) { $this->countryRepository = t3lib_div::makeInstance('Tx_Typo3Agencies_Domain_Repository_CountryRepository'); } return $this->countryRepository->findOneByCnIso2($this->country); }
protected function addCountries() { $countries = $this->countryRepository->findAll(); $availableCountries = array(); foreach ($countries as $country) { $availableCountries[$country->getCnIso2()] = $country->getCnShortEn(); } uasort($availableCountries, create_function('$a,$b', 'return strcasecmp($a, $b);')); $this->view->assign('countries', $availableCountries); }