You are here

public function GeoIpHandlerV1::rawRecord in GeoIP API 7.2

Returns an array of all information related the ip.

!Attention! The array isn't unified in any way. The return will change depending on which DB type / version is used.

Parameters

string $ip: The ip to resolve.

Return value

array Country code or FALSE on failure.

Overrides GeoIpHandlerInterface::rawRecord

File

src/GeoIpHandlerV1.php, line 88
The GeoIP API handler for version 1 - legacy.

Class

GeoIpHandlerV1

Namespace

Drupal\geoip

Code

public function rawRecord($ip = NULL) {
  $raw = (array) $this
    ->record($ip);

  // Be nice and add processed values.
  $raw['continent_name'] = $this
    ->continentName($ip);
  $raw['region_name'] = $this
    ->regionName($ip);

  // Ensure at least the info we have are set also if we don't use the city
  // database.
  $raw['country_code'] = $this
    ->countryCode($ip);
  $raw['country_name'] = $this
    ->countryName($ip);
  return $raw;
}