Add support for Anonymous IP database

This commit is contained in:
Dave Rolsky
2014-10-27 16:30:40 -05:00
parent 18686e11ac
commit fbf4583b3e
4 changed files with 86 additions and 1 deletions
+21
View File
@@ -91,6 +91,27 @@ class Reader implements ProviderInterface
return $this->modelFor('Country', 'Country', $ipAddress);
}
/**
* This method returns a GeoIP2 Anonymous IP model.
*
* @param string $ipAddress IPv4 or IPv6 address as a string.
*
* @return \GeoIp2\Model\Domain
*
* @throws \GeoIp2\Exception\AddressNotFoundException if the address is
* not in the database.
* @throws \MaxMind\Db\Reader\InvalidDatabaseException if the database
* is corrupt or invalid
*/
public function anonymousIp($ipAddress)
{
return $this->flatModelFor(
'AnonymousIp',
'GeoIP2-Anonymous-IP',
$ipAddress
);
}
/**
* This method returns a GeoIP2 Connection Type model.
*