Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

   1  <?php
   2  
   3  declare(strict_types=1);
   4  
   5  namespace GeoIp2\Record;
   6  
   7  /**
   8   * Contains data for the location record associated with an IP address.
   9   *
  10   * This record is returned by all location services and databases besides
  11   * Country.
  12   *
  13   * @property-read int|null $averageIncome The average income in US dollars
  14   * associated with the requested IP address. This attribute is only available
  15   * from the Insights service.
  16   * @property-read int|null $accuracyRadius The approximate accuracy radius in
  17   * kilometers around the latitude and longitude for the IP address. This is
  18   * the radius where we have a 67% confidence that the device using the IP
  19   * address resides within the circle centered at the latitude and longitude
  20   * with the provided radius.
  21   * @property-read float|null $latitude The approximate latitude of the location
  22   * associated with the IP address. This value is not precise and should not be
  23   * used to identify a particular address or household.
  24   * @property-read float|null $longitude The approximate longitude of the location
  25   * associated with the IP address. This value is not precise and should not be
  26   * used to identify a particular address or household.
  27   * @property-read int|null $populationDensity The estimated population per square
  28   * kilometer associated with the IP address. This attribute is only available
  29   * from the Insights service.
  30   * @property-read int|null $metroCode The metro code of the location if the location
  31   * is in the US. MaxMind returns the same metro codes as the
  32   * Google AdWords API. See
  33   * https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions.
  34   * @property-read string|null $timeZone The time zone associated with location, as
  35   * specified by the IANA Time Zone Database, e.g., "America/New_York". See
  36   * https://www.iana.org/time-zones.
  37   */
  38  class Location extends AbstractRecord
  39  {
  40      /**
  41       * @ignore
  42       */
  43      protected $validAttributes = [
  44          'averageIncome',
  45          'accuracyRadius',
  46          'latitude',
  47          'longitude',
  48          'metroCode',
  49          'populationDensity',
  50          'postalCode',
  51          'postalConfidence',
  52          'timeZone',
  53      ];
  54  }