Returns an array of countries
@return array
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);
    }
955422
public static function countries($continent='all')
	{
		if (isset(self::$countries[$continent]))
		{
			return self::$countries[$continent];
		}

		$adapter  = new \Geocoder\HttpAdapter\CurlHttpAdapter();

		$p = array();

		// Get a list of providers
		//
		// Each provider has an associated plugin. If the provider supports
		// the desired data look-up, it (the provider) will be returned by
		// the plugin. Otherwise, the plugin returns nothing.
		if ($providers = \Event::trigger('geocode.onGeocodeProvider', array('geocode.countries', $adapter)))
		{
			foreach ($providers as $provider)
			{
				if ($provider)
				{
					$p[] = $provider;
				}
			}
		}

		if (!count($p))
		{
			return self::$countries;
		}

		// Instantiate the Geocoder service and pass it the list of providers
		$geocoder = new \Geocoder\Geocoder();
		$geocoder->registerProvider(new \Geocoder\Provider\ChainProvider($p));

		// Try to get some data...
		$geocoder->setResultFactory(new Result\CountriesResultFactory());

		$countries = array();

		if ($data = $geocoder->geocode($continent))
		{
			foreach ($data as $item)
			{
				$country = new \stdClass();
				$country->code      = $item->getCountryCode();
				$country->name      = $item->getCountry();
				$country->continent = $item->getRegion();

				$countries[] = $country;
			}
		}

		self::$countries[$continent] = $countries;

		return self::$countries[$continent];
	}
1311589
public function getAllowedShippingCountries()
    {
        $allowedShippingCountriesRaw = $this->getAllowedShippingCountriesRaw();
        $allowedShippingCountries    = [];

        foreach ($allowedShippingCountriesRaw as $countryCode => $states) {
            $states = empty($states) ? ['All' => true] : $states;
            $states = array_filter(
                array_keys($states),
                function ($st) {
                    return is_string($st) ? $st : 'All';
                }
            );

            $states = in_array('All', $states, true) ? ['All'] : $states;

            array_walk(
                $states,
                function (&$state, $key, $country) {
                    $state = $state === 'All' ? $state : $country . '-' . $state;
                },
                $countryCode
            );

            $allowedShippingCountries[] =
                [
                    'country' => $countryCode,
                    'state'   => $states
                ];
        }

        return $allowedShippingCountries;
    }
1203663
protected function parseCountries($countries)
    {
        return Collection::make(is_array($countries) ? $countries : func_get_args())
                         ->map(function ($country) {
                             return strtoupper($country);
                         })
                         ->filter(function ($value) {
                             return static::isValidCountryCode($value);
                         })->toArray();
    }
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;
    }
79477
public function toArray()
    {
        $res = [];
        foreach ([
            'id',
            'displayTitle',
            'street',
            'number',
            'code',
            'town',
            'country',
            'longitude',
            'latitude',
        ] as $propertyName) {
            $res[$propertyName] = $this->{'get' . ucfirst($propertyName)}();
        }

        $res['name'] = TextUtils::truncate($this->getDisplayTitle(), 75);

        return $res;
    }
65445
public function getCountries()
    {
        if ($this->_aCountries === null) {
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            $this->_aCountries = [];
            $sSelect = 'select oxobjectid from oxobject2payment where oxpaymentid=' . $oDb->quote($this->getId()) . ' and oxtype = "oxcountry" ';
            $rs = $oDb->getCol($sSelect);
            $this->_aCountries = $rs;
        }

        return $this->_aCountries;
    }
217187
public function toArray()
    {
        $helper = Mage::helper('australia');
        return array(
            self::AUTHORITY_LEAVE => $helper->__('Authority To Leave'),
            self::AUTHORITY_LEAVE_REQUEST => $helper->__('Authority To leave can be requested'),
            self::REQUIRED => $helper->__('Signature required'),
        );
    }
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);
    }
453468
public function toArray(): array
    {
        return  [
            'countryCode' => $this->getCountryCode(),
            'vatNumber'   => $this->getVatNumber(),
            'requestDate' => $this->getRequestDate()->format('Y-m-d'),
            'valid'       => $this->isValid(),
            'name'        => $this->getName(),
            'address'     => $this->getAddress(),
            'identifier'  => $this->getIdentifier(),
            'nameMatch'   => $this->getNameMatch(),
            'companyTypeMatch' => $this->getCompanyTypeMatch(),
            'streetMatch' => $this->getStreetMatch(),
            'postcodeMatch' => $this->getPostcodeMatch(),
            'cityMatch' => $this->getCityMatch(),
        ];
    }
1145401
public function toArray()
    {
        return [
            'openId'        => $this->openId,
            'unionId'       => $this->unionId,
            'nickName'      => $this->nickName,

            'sex'           => $this->sex->getValue(),
            'city'          => $this->city,
            'province'      => $this->province,
            'country'       => $this->country,
            'headImgUrl'    => $this->headImgUrl,

            'subscribe'     => $this->subscribe->getValue(),
            'subscribeTime' => $this->subscribeTime,
            'groupId'       => $this->groupId,
        ];
    }
640399
public function getUiLangsList() {
		$result = [];
		$UIlangs = $this->_modelConfigSettingsApp->getUiLangs();
		if (empty($UIlangs)) {
			return $result;
		}

		$language = new Language();
		foreach ($UIlangs as $country => $UIlang) {
			$langName = $language->convertLangCode($UIlang, 'native');
			if (empty($langName)) {
				continue;
			}

			$result[$country] = mb_ucfirst($langName);
		}

		return $result;
	}
1157939
public function toArray()
    {
      $_address = [];

      if($this->hasCountry())
        $_address['country'] = $this->getCountry();

      if($this->hasState())
        $_address['state'] = $this->getState();

      if($this->hasMunicipality())
        $_address['municipality'] = $this->getMunicipality();

      if($this->hasCity())
        $_address['city'] = $this->getCity();

      if($this->hasDistrict())
        $_address['district'] = $this->getDistrict();

      if($this->hasNeighbourhood())
        $_address['neighbourhood'] = $this->getNeighbourhood();

      if($this->hasStreet())
        $_address['street'] = $this->getStreet();

      if($this->hasNumber())
        $_address['number'] = $this->getNumber();

      if($this->hasAddition())
        $_address['addition'] = $this->getAddition();

      if($this->hasZipcode())
        $_address['zipcode'] = $this->getZipcode();

      return $_address;
    }
1100657
public function actionIndex()
{
    $searchModel  = new CountrySearch;
    $dataProvider = $searchModel->search($_GET);

Tabs::clearLocalStorage();

Url::remember();
\Yii::$app->session['__crudReturnUrl'] = null;

return $this->render('index', [
'dataProvider' => $dataProvider,
    'searchModel' => $searchModel,
]);
}
344749
protected function getGlobals()
    {
        global $GLOBALS;

        $names = \array_keys($GLOBALS);
        \natcasesort($names);

        $ret = [];
        foreach ($names as $name) {
            $ret[$name] = $GLOBALS[$name];
        }

        return $ret;
    }
650280
def get_countries(self):
        
        qs = Venue.objects.values('country') \
                                    .exclude(country='') \
                                    .distinct() \
                                    .order_by('country')

        countries = []

        for c in qs:
            countries.append({
                'code': c['country'],
                'name': Venue.get_country_name(c['country'])
            })

        return sorted(countries, key=lambda k: k['name'])
1187529
public function toArray()
    {
        $array = array();

        $array['orderNumber'] = $this->orderNumber;
        if (isset($this->referenceNumber)) {
            $array['referenceNumber'] = $this->referenceNumber;
        }
        if (isset($this->description)) {
            $array['description'] = $this->description;
        }
        $array['currency'] = $this->currency;
        if (isset($this->locale)) {
            $array['locale'] = $this->locale;
        }
        $array['orderDetails'] = array(
            'includeVat' => $this->vatMode,
            'products'   => array(),
        );
        if ($this->urlSet !== null) {
            $array['urlSet'] = $this->urlSet->toArray();
        }
        if ($this->contact !== null) {
            $array['orderDetails']['contact'] = $this->contact->toArray();
        }
        foreach ($this->products as $product) {
            $array['orderDetails']['products'][] = $product->toArray();
        }

        return $array;
    }