PHP 클래스 Pop\Geo\Geo

저자: Nick Sagona, III ([email protected])
파일 보기 프로젝트 열기: nicksagona/PopPHP 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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