\Kronolith_Geo_Base

Storage driver for Kronolith's Geo location data.

Copyright 2009-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Summary

Methods
Properties
Constants
__construct()
setLocation()
getLocation()
deleteLocation()
search()
No public properties found
No constants found
No protected methods found
$_db
N/A
No private methods found
No private properties found
N/A

Properties

$_db

$_db : \Horde_Db_Adapter

Type

\Horde_Db_Adapter

Methods

__construct()

__construct(\Horde_Db_Adapter  $adapter) : \Kronolith_Geo_Base

Parameters

\Horde_Db_Adapter $adapter

The Horde_Db adapter

Returns

\Kronolith_Geo_Base

setLocation()

setLocation(string  $event_id, array  $point) 

Save location of event to storage

Parameters

string $event_id

The event id

array $point

Hash containing 'lat' and 'lon' coordinates

getLocation()

getLocation(string  $event_id) : array

Retrieve the location of the specified event.

Parameters

string $event_id

The event id

Returns

array —

A hash containing 'lat' and 'lon'

deleteLocation()

deleteLocation(string  $event_id) 

Removes the event's location from storage.

Parameters

string $event_id

The event it.

search()

search(array  $criteria) : array

Search for events close to a given point.

Parameters

array $criteria

An array of:

point  - lat/lon hash
radius - the radius to search in
limit  - limit the number of hits
factor - Conversion factor for miles per distance unit [default is 69].

Returns

array —

of event ids with locations near the specified criteria.