Returns an array of cities for the given country and state ID
@return array
3627
public function searchCityAjax()
    {
        $country = $this->getPosted('country');
        $state_id = $this->getPosted('state_id');

        if (empty($country) || empty($state_id)) {
            return array();
        }

        $conditions = array(
            'status' => 1,
            'state_status' => 1,
            'country_status' => 1,
            'country' => $country,
            'state_id' => $state_id,
        );

        return (array) $this->city->getList($conditions);
    }
1334930
public function getTableColumns(): array
    {
        $columns = [
            'country_id' => $this->headerText(trans('HCRegion::regions_city.country_id')),
            'translation.label' => $this->headerText(trans('HCRegion::regions_city.label')),
            'visible' => $this->headerCheckBox(trans('HCRegion::regions_city.visible')),
        ];

        return $columns;
    }
566329
public function getAllowedAddressCountries()
    {
        $allowedShippingCountries    = $this->getAllowedShippingCountries();
        $allowedShippingCountriesMap = array_map(
            function ($country) {
                return $country['country'];
            },
            $allowedShippingCountries
        );

        $allowedAddressCountries = [];
        foreach ($this->mainShipHelper->getMageShippingCountries() as $addressCountry) {
            $state  = array_search($addressCountry, $allowedShippingCountriesMap, true);
            $states = $state !== false ? $allowedShippingCountries[$state]['state'] : ['All'];

            $allowedAddressCountries[] =
                [
                    'country' => $addressCountry,
                    'state'   => $states
                ];
        }

        return $allowedAddressCountries;
    }
309442
public function getCitySubnational()
    {
        $str = $this->city;
        if (!empty($this->subnational_division)) {
            $str .= ", " . $this->subnational_division;
        }

        return $str;
    }
231186
public static function city()
    {
        $format = static::$cityFormats[array_rand(static::$cityFormats)];

        $parts = array();
        foreach ($format['parts'] as $function) {
            $parts[] = call_user_func($function);
        }

        return vsprintf($format['format'], $parts);
    }
1087828
public function getCountriesArray()
    {
        $return = json_decode($this->Country);

        if (empty($return) && isset($this->Country)) {
            $return = [$this->Country];
        }

        return $return;
    }
1260581
public function listAvailableStates(): array
    {
        if (!empty($this->states) && \is_array($this->states)) {
            return \array_keys($this->states);
        } else {
            return [];
        }
    }
870457
public function get($ip)
    {
        $data = $this->getRaw($ip);

        if (empty($data) || (array_get($data, 'status') === 'fail')) {
            return $this->getDefault();
        }

        return [
            'city' => array_get($data, 'city'),
            'country' => array_get($data, 'country'),
            'countryCode' => array_get($data, 'countryCode'),
            'latitude' => (float) number_format(array_get($data, 'lat'), 5),
            'longitude' => (float) number_format(array_get($data, 'lon'), 5),
            'region' => array_get($data, 'regionName'),
            'regionCode' => array_get($data, 'region'),
            'timezone' => array_get($data, 'timezone'),
            'postalCode' => array_get($data, 'zip'),
        ];
    }
356769
public function getBusinessData()
    {
        $business = $this->getBusiness();

        if (!$business) {
            return array();
        }

        $data = array(
            'address' => array(
                'streetAddress' => $business->getAddress1(),
                'locality' => $business->getCity(),
                'postalCode' => $business->getPostCode(),
                'region' => $business->getState(),
            ),
            'dbaName' => $business->getDbaName(),
            'email' => $business->getEmail(),
            'legalName' => $business->getLegalName(),
            'taxId' => $business->getTaxId(),
        );

        // Remove null values
        $data = array_filter($data, function($value){
            return ! is_null($value);
        });

        if (empty($data)) {
            return $data;
        } else {
            return array('business' => $data);
        }
    }
15171
public static function get_all() {
        $states = array();
        $us = new ReflectionClass('question_state');
        foreach ($us->getStaticProperties() as $name => $notused) {
            $states[] = self::$$name;
        }
        return $states;
    }
1174045
public function city()
	{
		$requestParams = $this->initRequestParams('city');
		$this->request('city', $requestParams);

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

        return $countries;
    }
202317
protected function getCountries() {
        if (!$this->_countries) {
            $this->_countries = new CountryList($this->version);
        }

        return $this->_countries;
    }
602193
public function getIndividualData()
    {
        $individual = $this->getIndividual();

        if (!$individual) {
            return array();
        }

        $data = array(
            'address' => array(
                'streetAddress' => $individual->getAddress1(),
                'locality' => $individual->getCity(),
                'postalCode' => $individual->getPostCode(),
                'region' => $individual->getState(),
            ),
            'dateOfBirth' => $individual->getBirthday(),
            'email' => $individual->getEmail(),
            'firstName' => $individual->getFirstName(),
            'lastName' => $individual->getLastName(),
            'phone' => $individual->getPhone(),
            'ssn' => $individual->getSsn(),
        );

        // Remove null values
        $data = array_filter($data, function($value){
            return ! is_null($value);
        });

        if (empty($data)) {
            return $data;
        } else {
            return array('individual' => $data);
        }
    }
2485
protected function getListCountry()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        return (array) $this->country->getList($conditions);
    }
35294
public static function getCountries()
    {
        // Put frequently country at the top
        $countries = array();
        $frequently = array();

        foreach (Convert::$aCountries as $k => $country) {
            //echo strtolower($k) . '<br />';
            if (in_array(strtolower($k), ['be', 'fr', 'gb'])) {
                $frequently[strtolower($k)] = $country;
            } else {
                $countries[strtolower($k)] = $country;
            }
        }

        return array_merge($frequently, $countries);
    }
785753
public function getCoordinatesForAddress($street = null, $zip = null, $city = null, $country = ''): array
    {
        $addressParts = [];
        foreach ([$street, $zip . ' ' . $city, $country] as $addressPart) {
            if (empty($addressPart)) {
                continue;
            }
            $addressParts[] = trim($addressPart);
        }
        $address = ltrim(implode(',', $addressParts), ',');
        if (empty($address)) {
            return [];
        }
        $cacheObject = $this->initializeCache();
        $cacheKey = 'geocode-' . strtolower(str_replace(' ', '-', preg_replace('/[^0-9a-zA-Z ]/m', '', $address)));
        // Found in cache? Return it.
        if ($cacheObject->has($cacheKey)) {
            return $cacheObject->get($cacheKey);
        }
        $result = $this->getApiCallResult(
            $this->geocodingUrl . '&address=' . urlencode($address)
        );
        if (empty($result) || empty($result['results']) || empty($result['results'][0]['geometry'])) {
            return [];
        }
        $geometry = $result['results'][0]['geometry'];
        $result = [
            'latitude' => $geometry['location']['lat'],
            'longitude' => $geometry['location']['lng'],
        ];
        // Now store the $result in cache and return
        $cacheObject->set($cacheKey, $result, [], $this->cacheTime);
        return $result;
    }