You are here

private function Database::readMccMncAndMobileCarrierName in Smart IP 6.2

Same name and namespace in other branches
  1. 7.2 includes/vendor/ip2location/ip2location-php/IP2Location.php \IP2Location\Database::readMccMncAndMobileCarrierName()

High level function to fetch the MCC, MNC, and mobile carrier name

@access private

Parameters

int $pointer Position to read from, if false, return self::INVALID_IP_ADDRESS:

Return value

array

1 call to Database::readMccMncAndMobileCarrierName()
Database::lookup in includes/vendor/ip2location/ip2location-php/IP2Location.php
This function will look the given IP address up in the database and return the result(s) asked for

File

includes/vendor/ip2location/ip2location-php/IP2Location.php, line 1378

Class

Database
IP2Location database class

Namespace

IP2Location

Code

private function readMccMncAndMobileCarrierName($pointer) {
  if (false === $pointer) {

    // Deal with invalid IPs
    $mcc = self::INVALID_IP_ADDRESS;
    $mnc = self::INVALID_IP_ADDRESS;
    $mobileCarrierName = self::INVALID_IP_ADDRESS;
  }
  elseif (0 === self::$columns[self::MCC][$this->type]) {

    // If the field is not suported, return accordingly
    $mcc = self::FIELD_NOT_SUPPORTED;
    $mnc = self::FIELD_NOT_SUPPORTED;
    $mobileCarrierName = self::FIELD_NOT_SUPPORTED;
  }
  else {

    // Read MCC, MNC, and mobile carrier name
    $mcc = $this
      ->readString($pointer + self::$columns[self::MCC][$this->type]);
    $mnc = $this
      ->readString($pointer + self::$columns[self::MNC][$this->type]);
    $mobileCarrierName = $this
      ->readString($pointer + self::$columns[self::MOBILE_CARRIER_NAME][$this->type]);
  }
  return [
    $mcc,
    $mnc,
    $mobileCarrierName,
  ];
}