Overview

Namespaces

  • GeoIp2
    • Database
    • Exception
    • Model
    • Record
    • WebService
  • MaxMind
    • Db
      • Reader
  • PHP

Classes

  • GeoIp2\Database\Reader
  • GeoIp2\Model\AnonymousIp
  • GeoIp2\Model\Asn
  • GeoIp2\Model\City
  • GeoIp2\Model\ConnectionType
  • GeoIp2\Model\Country
  • GeoIp2\Model\Domain
  • GeoIp2\Model\Enterprise
  • GeoIp2\Model\Insights
  • GeoIp2\Model\Isp
  • GeoIp2\Record\AbstractPlaceRecord
  • GeoIp2\Record\AbstractRecord
  • GeoIp2\Record\City
  • GeoIp2\Record\Continent
  • GeoIp2\Record\Country
  • GeoIp2\Record\Location
  • GeoIp2\Record\MaxMind
  • GeoIp2\Record\Postal
  • GeoIp2\Record\RepresentedCountry
  • GeoIp2\Record\Subdivision
  • GeoIp2\Record\Traits
  • GeoIp2\WebService\Client
  • MaxMind\Db\Reader
  • MaxMind\Db\Reader\Decoder
  • MaxMind\Db\Reader\Metadata
  • MaxMind\Db\Reader\Util

Interfaces

  • GeoIp2\ProviderInterface
  • JsonSerializable
  • Throwable

Exceptions

  • BadFunctionCallException
  • BadMethodCallException
  • Exception
  • GeoIp2\Exception\AddressNotFoundException
  • GeoIp2\Exception\AuthenticationException
  • GeoIp2\Exception\GeoIp2Exception
  • GeoIp2\Exception\HttpException
  • GeoIp2\Exception\InvalidRequestException
  • GeoIp2\Exception\OutOfQueriesException
  • InvalidArgumentException
  • LogicException
  • MaxMind\Db\Reader\InvalidDatabaseException
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: namespace GeoIp2\Model;
 4: 
 5: /**
 6:  * Model class for the data returned by GeoIP2 Country web service and database.
 7:  *
 8:  * The only difference between the City and Insights model classes is which
 9:  * fields in each record may be populated. See
10:  * http://dev.maxmind.com/geoip/geoip2/web-services more details.
11:  *
12:  * @property-read \GeoIp2\Record\Continent $continent Continent data for the
13:  * requested IP address.
14:  * @property-read \GeoIp2\Record\Country $country Country data for the requested
15:  * IP address. This object represents the country where MaxMind believes the
16:  * end user is located.
17:  * @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
18:  * account.
19:  * @property-read \GeoIp2\Record\Country $registeredCountry Registered country
20:  * data for the requested IP address. This record represents the country
21:  * where the ISP has registered a given IP block and may differ from the
22:  * user's country.
23:  * @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
24:  * Represented country data for the requested IP address. The represented
25:  * country is used for things like military bases. It is only present when
26:  * the represented country differs from the country.
27:  * @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
28:  * requested IP address.
29:  */
30: class Country extends AbstractModel
31: {
32:     protected $continent;
33:     protected $country;
34:     protected $locales;
35:     protected $maxmind;
36:     protected $registeredCountry;
37:     protected $representedCountry;
38:     protected $traits;
39: 
40:     /**
41:      * @ignore
42:      *
43:      * @param mixed $raw
44:      * @param mixed $locales
45:      */
46:     public function __construct($raw, $locales = ['en'])
47:     {
48:         parent::__construct($raw);
49: 
50:         $this->continent = new \GeoIp2\Record\Continent(
51:             $this->get('continent'),
52:             $locales
53:         );
54:         $this->country = new \GeoIp2\Record\Country(
55:             $this->get('country'),
56:             $locales
57:         );
58:         $this->maxmind = new \GeoIp2\Record\MaxMind($this->get('maxmind'));
59:         $this->registeredCountry = new \GeoIp2\Record\Country(
60:             $this->get('registered_country'),
61:             $locales
62:         );
63:         $this->representedCountry = new \GeoIp2\Record\RepresentedCountry(
64:             $this->get('represented_country'),
65:             $locales
66:         );
67:         $this->traits = new \GeoIp2\Record\Traits($this->get('traits'));
68: 
69:         $this->locales = $locales;
70:     }
71: }
72: 
GeoIP2 PHP API v2.9.0 API documentation generated by ApiGen