Kronolith_Geo_Base
in package
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.
Tags
Table of Contents
- $_db : Horde_Db_Adapter
- __construct() : Kronolith_Geo_Base
- deleteLocation() : mixed
- Removes the event's location from storage.
- getLocation() : array<string|int, mixed>
- Retrieve the location of the specified event.
- search() : array<string|int, mixed>
- Search for events close to a given point.
- setLocation() : mixed
- Save location of event to storage
Properties
$_db
protected
Horde_Db_Adapter
$_db
Methods
__construct()
public
__construct(Horde_Db_Adapter $adapter) : Kronolith_Geo_Base
Parameters
- $adapter : Horde_Db_Adapter
-
The Horde_Db adapter
Return values
Kronolith_Geo_Base —deleteLocation()
Removes the event's location from storage.
public
abstract deleteLocation(string $event_id) : mixed
Parameters
- $event_id : string
-
The event it.
Return values
mixed —getLocation()
Retrieve the location of the specified event.
public
abstract getLocation(string $event_id) : array<string|int, mixed>
Parameters
- $event_id : string
-
The event id
Return values
array<string|int, mixed> —A hash containing 'lat' and 'lon'
search()
Search for events close to a given point.
public
abstract search(array<string|int, mixed> $criteria) : array<string|int, mixed>
Parameters
- $criteria : array<string|int, mixed>
-
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].
Return values
array<string|int, mixed> —of event ids with locations near the specified criteria.
setLocation()
Save location of event to storage
public
abstract setLocation(string $event_id, array<string|int, mixed> $point) : mixed
Parameters
- $event_id : string
-
The event id
- $point : array<string|int, mixed>
-
Hash containing 'lat' and 'lon' coordinates