Get a list of regions, filtered by the provided country code

@return SSList
963894
public function getList($country)
    {
        $list = Region::get()
            ->filter("CountryCode", strtoupper($country));

        if (!$list->exists() && $this->getCreateEmptyDefault()) {
            $countries = i18n::getData()->getCountries();
            if (isset($countries[strtolower($country)])) {
                $name = $countries[strtolower($country)];
            } else {
                $name = $country;
            }
            $list = ArrayList::create();
            $list->push(Region::create([
                "Name" => $name,
                "Type" => "Nation",
                "Code" => strtoupper($country),
                "CountryCode" => strtoupper($country)
            ]));
        }

        return $list;
    }
906683
public function filterByCountry($countryCode)
    {
        $filteredArr = array();
        foreach ($this->_paymentMethodsArrayFiltered as $paymentMethod) {
            $continue = true;
            foreach ($paymentMethod["Issuers"] as $issuer) {
                foreach ($issuer["Countries"] as $country) {
                    if (strtoupper($country["CountryCode"]) == strtoupper($countryCode) || $country["CountryCode"] == "00") {
                        array_push($filteredArr, $paymentMethod);
                        $continue = false;
                    }
                    if (!$continue)
                        break;
                }
                if (!$continue)
                    break;
            }
        }
        $this->_paymentMethodsArrayFiltered = $filteredArr;
        return $this;
    }
993619
public function getRelatedCountries()
    {
        $conn = $this->app->getApplicationBox()->get_connection();

        $sql = 'SELECT DISTINCT Users.country ' . $this->generate_sql_constraints() . ' ORDER BY Users.country';

        $stmt = $conn->prepare($sql);
        $stmt->execute($this->sql_params);
        $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
        $stmt->closeCursor();

        $countries = [];
        $listCountry = Countries::getCountries($this->app['locale']);
        foreach ($rs as $row) {
            if (trim($row['country']) === '') {
                continue;
            }

            if (isset($listCountry[$row['country']])) {
                $countries[$row['country']] = $listCountry[$row['country']];
            }
        }

        return $countries;
    }
397858
def regions(self):
        """"""
        url = "%s/regions" % self.root
        params = {"f": "json"}
        return self._get(url=url,
                            param_dict=params,
                            proxy_url=self._proxy_url,
                            proxy_port=self._proxy_port)
1054178
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllCountriesGeoZones(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllCountriesGeoZones();
        }
    }
661716
@Override
	public List<CommerceCountry> findAll() {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
162506
protected function getListCountry()
    {
        $code = $this->getParam(0);

        if (!isset($code)) {
            return $this->country->getList(array('limit' => $this->getLimit()));
        }

        $country = $this->country->get($code);

        if (empty($country)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($country);
    }
673301
private function getLocalizedAreas()
    {
        $areas = $this->getParameter('sulu_snippet.areas');
        $locale = $this->getUser()->getLocale();

        $localizedAreas = [];

        foreach ($areas as $type) {
            $title = ucfirst($type['key']);

            if (isset($type['title'][$locale])) {
                $title = $type['title'][$locale];
            }

            $localizedAreas[$type['key']] = [
                'title' => $title,
                'template' => $type['template'],
            ];
        }

        return $localizedAreas;
    }
424529
private function getCountries()
    {
        $countries = [];
        foreach (Intl::getRegionBundle()->getCountryNames() as $countryCode => $countryName) {
            $countries[strtolower($countryCode)] = new PropertyParameter(strtolower($countryCode), $countryName);
        }

        return $countries;
    }
1152510
public function getCountryCode()
    {
        $localeIso = $this->locale->getIso();

        if (isset($this->localeCountryAssociations[$localeIso])) {
            return Locale::create($this->localeCountryAssociations[$localeIso]);
        }

        $regionLocale = \Locale::getRegion($localeIso);

        return $regionLocale
            ? Locale::create($regionLocale)
            : $this->locale;
    }
466404
public function listCountryState($code)
    {
        $this->setCountry($code);
        $this->actionListCountryState();
        $this->setTitleListCountryState();
        $this->setBreadcrumbListCountryState();
        $this->setFilterListCountryState();
        $this->setPagerListCountryState();

        $this->setData('country', $this->data_country);
        $this->setData('states', $this->getListCountryState());

        $this->outputListCountryState();
    }
9667
public function get_regions() {
        if (is_null($this->defaultregion)) {
            $this->page->initialise_theme_and_output();
        }
        return array_keys($this->regions);
    }
1122220
public function countries(Request $request = null)
    {
        $query = Country::with('zone');

        if ($request) {
            $resource = new Collection($query, 'country', $request);
            return $this->respondWithCollection($resource);
        }
        return $query->get();
    }
798344
def regions():
    
    return [RDSRegionInfo(name='us-east-1',
                          endpoint='rds.us-east-1.amazonaws.com'),
            RDSRegionInfo(name='eu-west-1',
                          endpoint='rds.eu-west-1.amazonaws.com'),
            RDSRegionInfo(name='us-west-1',
                          endpoint='rds.us-west-1.amazonaws.com'),
            RDSRegionInfo(name='us-west-2',
                          endpoint='rds.us-west-2.amazonaws.com'),
            RDSRegionInfo(name='sa-east-1',
                          endpoint='rds.sa-east-1.amazonaws.com'),
            RDSRegionInfo(name='ap-northeast-1',
                          endpoint='rds.ap-northeast-1.amazonaws.com'),
            RDSRegionInfo(name='ap-southeast-1',
                          endpoint='rds.ap-southeast-1.amazonaws.com')
            ]
1344151
public function getList()
	{
		$this->getResponse()
			->setStatusCode(Response::STATUS_CODE_200);
		
		// 1) getting params
		$page = (int) $this->params()->fromQuery("page", 1);
		$category = $this->params()->fromQuery("category", "usato");
		$purpose = $this->params()->fromQuery("purpose", "compravendita");
		$location = $this->params()->fromQuery("location", "italia");
		$limit = 30;
		$offset = ($page * $limit) - $limit;
		$returnSelect = true;
		
		// 2) Discard useless params and prepare them to be passed to the model
		$params = $this->requestToSearchParams($this->params()->fromQuery());
		$params = is_array($params) ? $params + compact('returnSelect', 'offset', 'limit') : array();
		
		if(empty($params)) {
            return new JsonModel(array());
		}
		
		// 3) get only for current user?
		$onlyCurrentUser = (bool) $this->params()->fromQuery("current", false);
		$k = 0;
		foreach($params['field'] as $f) {
			if('current' == $f || 'user' == $f) {
				unset($params['field'][$k]);
				unset($params['value'][$k]);
			}
			$k++;
		}
		if($onlyCurrentUser) {
			if($this->zfcUserAuthentication()->hasIdentity()) {
				$identity = $this->zfcUserAuthentication()->getIdentity();
// 				$params['field'][] = 'user';
// 				$params['value'][] = sha1('neo' . $identity->getUserId() . 'bazaar');
				$params['field'][] = 'account';
				$params['value'][] = sha1('neo' . $identity->getUserId() . 'bazaar');
			} else {
				// Questo è necessario per non far restituire la lista completa se l'utente non è connesso
				$params['field'][] = 'account';
				$params['value'][] = sha1('usernotconnected');
			}
		}
		
		// 4) all classifieds? This should be requested only by the admin, will not use sphinx
		if((bool) $this->params()->fromQuery("full", false)) {
			if($this->zfcUserAuthentication()->hasIdentity()) {
			    $params = $this->params()->fromQuery();
				$identity = $this->zfcUserAuthentication()->getIdentity();
				$userModel = $this->getServiceLocator()->get('user.model.user');
				$userModel->init($identity, $this->getServiceLocator());
				if(!$userModel->getIsAdmin()) {
				    return new JsonModel(array());
				}
				
				$paginator = $this->getServiceLocator()->get('document.paginator.classifiedFull');
				$paginator->build($params);

				$data = array();
				foreach($paginator as $post) {
            		$file = $this->getServiceLocator()->get('document.model.classifiedAdminListing');
				    $data[] = $file->init($post);
				}

				$routeName = 'DocumentAdminClassified/page';
				$routeParams = array('page' => $this->params()->fromQuery("page", 1));
				$queryParams = array('full' => 1, 'user' => $this->params()->fromQuery("user"));
				$data = $this->getModel()->getPaginationData($this->getServiceLocator(), $paginator, $data, $routeName, $routeParams, $queryParams);

				return new JsonModel($data);
			}
		}
		
		// 5) Pass param to the model and get the data
		$data = $this->getModel()->getList($params, $this->getServiceLocator());
		
		return new JsonModel($data);
	}
1139737
public function commonCountriesList(): string
    {
        $countries = $this->statsPlaces();

        if (empty($countries)) {
            return '';
        }

        $top10 = [];
        $i     = 1;

        // Get the country names for each language
        $country_names = [];
        foreach (I18N::activeLocales() as $locale) {
            I18N::init($locale->languageTag());
            $all_countries = $this->country_service->getAllCountries();
            foreach ($all_countries as $country_code => $country_name) {
                $country_names[$country_name] = $country_code;
            }
        }

        I18N::init(WT_LOCALE);

        $all_db_countries = [];
        foreach ($countries as $place) {
            $country = trim($place->country);
            if (array_key_exists($country, $country_names)) {
                if (isset($all_db_countries[$country_names[$country]][$country])) {
                    $all_db_countries[$country_names[$country]][$country] += (int) $place->tot;
                } else {
                    $all_db_countries[$country_names[$country]][$country] = (int) $place->tot;
                }
            }
        }

        // get all the user’s countries names
        $all_countries = $this->country_service->getAllCountries();

        foreach ($all_db_countries as $country_code => $country) {
            foreach ($country as $country_name => $tot) {
                $tmp     = new Place($country_name, $this->tree);

                $top10[] = [
                    'place' => $tmp,
                    'count' => $tot,
                    'name'  => $all_countries[$country_code],
                ];
            }

            if ($i++ === 10) {
                break;
            }
        }

        return view(
            'statistics/other/top10-list',
            [
                'records' => $top10,
            ]
        );
    }
132677
public function getCountryList($includeInternalCodes = false)
    {
        if ($this->countryList === null) {
            $this->countryList = require __DIR__ . '/../Resources/countries.php';
        }
        if ($this->countryExtraList === null) {
            $this->countryExtraList = require __DIR__ . '/../Resources/countries-extra.php';
        }

        if ($includeInternalCodes) {
            return array_merge($this->countryList, $this->countryExtraList);
        }

        return $this->countryList;
    }