\MOD_geo

Collection of methods related to geographical data.

An example for its use: $geo = MOD_geo::get(); // get the singleton instance $id = $geo->getCityID($cityname);

Summary

Methods
Properties
Constants
get()
getAllCountries()
getCityID()
getPlaceNameByID()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__construct()
$_instance
N/A

Properties

$_instance

$_instance : \MOD_geo

Singleton instance

Type

\MOD_geo

Methods

get()

get() : \PApps

singleton getter

Returns

\PApps

getAllCountries()

getAllCountries() : array

Get all countries

Returns

array —

List of countries in geonames_cache table, objects with

          string properties, empty if none

getCityID()

getCityID(string $placeName, boolean $allowAmbigious) : integer|boolean

Get Geonames ID for a place name.

Parameters

string $placeName

Name of place (case-sensitive)

boolean $allowAmbigious

Set true if more than one place is

                           allowed - in this case just the first hit
                           is returned

Returns

integer|boolean —

Geonames ID of a place in database, false if

                    none found

getPlaceNameByID()

getPlaceNameByID(integer $placeID) : string|boolean

Get name for a place by ID.

Parameters

integer $placeID

ID of place in Geonames database

Returns

string|boolean —

Name of place in Geonames database, false if none

__construct()

__construct()