PHP Класс Pop\Geo\Geo

Автор: Nick Sagona, III ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$databases string Array of available databases
$host string Host name to look up
$hostInfo array Host info
$latitude string Latitude value
$longitude string Longitude value

Открытые методы

Метод Описание
__construct ( array $options = [] ) : Geo Constructor
__get ( string $name ) : mixed Get method to return the value of hostInfo[$name].
calculateDistance ( array $origin, array $destination, integer $round = 2, boolean $km = false ) : mixed Method to calculate the distance between 2 sets of coordinate
distanceTo ( Geo $dest, integer $round = 2, boolean $km = false ) : mixed Get distance from current Geo object coordinates to another
getDatabases ( ) : array Get all available databases
getHostInfo ( ) : array Get host info
getLatitude ( ) : string Get latitude
getLongitude ( ) : string Get longitude
isDbAvailable ( string $name ) : boolean Get an available database

Защищенные методы

Метод Описание
getAvailableDatabases ( ) : void Get available databases
getGeoIpHostInfo ( ) : void Get GeoIp host information

Описание методов

__construct() публичный Метод

Instantiate the Geo object.
public __construct ( array $options = [] ) : Geo
$options array
Результат Geo

__get() публичный Метод

Get method to return the value of hostInfo[$name].
public __get ( string $name ) : mixed
$name string
Результат mixed

calculateDistance() публичный статический Метод

Method to calculate the distance between 2 sets of coordinate
public static calculateDistance ( array $origin, array $destination, integer $round = 2, boolean $km = false ) : mixed
$origin array
$destination array
$round integer
$km boolean
Результат mixed

distanceTo() публичный Метод

Get distance from current Geo object coordinates to another
public distanceTo ( Geo $dest, integer $round = 2, boolean $km = false ) : mixed
$dest Geo
$round integer
$km boolean
Результат mixed

getAvailableDatabases() защищенный Метод

Get available databases
protected getAvailableDatabases ( ) : void
Результат void

getDatabases() публичный Метод

Get all available databases
public getDatabases ( ) : array
Результат array

getGeoIpHostInfo() защищенный Метод

Get GeoIp host information
protected getGeoIpHostInfo ( ) : void
Результат void

getHostInfo() публичный Метод

Get host info
public getHostInfo ( ) : array
Результат array

getLatitude() публичный Метод

Get latitude
public getLatitude ( ) : string
Результат string

getLongitude() публичный Метод

Get longitude
public getLongitude ( ) : string
Результат string

isDbAvailable() публичный Метод

Get an available database
public isDbAvailable ( string $name ) : boolean
$name string
Результат boolean

Описание свойств

$databases защищенное свойство

Array of available databases
protected string $databases
Результат string

$host защищенное свойство

Host name to look up
protected string $host
Результат string

$hostInfo защищенное свойство

Host info
protected array $hostInfo
Результат array

$latitude защищенное свойство

Latitude value
protected string $latitude
Результат string

$longitude защищенное свойство

Longitude value
protected string $longitude
Результат string