You are here

private function Reader::modelFor in Smart IP 6.2

Same name and namespace in other branches
  1. 7.2 includes/vendor/geoip2/geoip2/src/Database/Reader.php \GeoIp2\Database\Reader::modelFor()
3 calls to Reader::modelFor()
Reader::city in includes/vendor/geoip2/geoip2/src/Database/Reader.php
This method returns a GeoIP2 City model.
Reader::country in includes/vendor/geoip2/geoip2/src/Database/Reader.php
This method returns a GeoIP2 Country model.
Reader::enterprise in includes/vendor/geoip2/geoip2/src/Database/Reader.php
This method returns a GeoIP2 Enterprise model.

File

includes/vendor/geoip2/geoip2/src/Database/Reader.php, line 191

Class

Reader
Instances of this class provide a reader for the GeoIP2 database format. IP addresses can be looked up using the database specific methods.

Namespace

GeoIp2\Database

Code

private function modelFor($class, $type, $ipAddress) {
  $record = $this
    ->getRecord($class, $type, $ipAddress);
  $record['traits']['ip_address'] = $ipAddress;
  $class = "GeoIp2\\Model\\" . $class;
  return new $class($record, $this->locales);
}