LGV_TZ_Lookup 1.4.2
Time zone lookup for PHP applications and HTTP clients
Loading...
Searching...
No Matches
LGV_TZ_Lookup_Loader Class Reference
Inheritance diagram for LGV_TZ_Lookup_Loader:
Collaboration diagram for LGV_TZ_Lookup_Loader:

Public Member Functions

 __construct ($inDBObject)

Static Public Member Functions

static listener_action ( $inItem)

Static Public Attributes

static $db_object

Static Private Member Functions

static _extract_entity ($tzid, $coords_array)
static _process_entity ($inEntity)
static _update_coords ( $current, $next)

Detailed Description

This class is a mainly static class that will process the main data file, and initialize the database.

It extends the streamer's GeoJSON listener class.

It will not require any constructor data, and will set itself up.

Definition at line 54 of file LGV_TZ_Lookup_Loader.class.php.

Constructor & Destructor Documentation

◆ __construct()

LGV_TZ_Lookup_Loader::__construct ( $inDBObject)

The constructor.

Parameters
$inDBObjectAn initialized database instance for this handler.

Definition at line 66 of file LGV_TZ_Lookup_Loader.class.php.

Member Function Documentation

◆ _extract_entity()

LGV_TZ_Lookup_Loader::_extract_entity ( $tzid,
$coords_array )
staticprivate

This function generates a new entity, based on the given time zone ID, and the polygon array.

Returns
: A new instance of LGV_TZ_Lookup_Entity.
Parameters
$tzidThis is the standard TZ time zone designator that applies to this entity.
$coords_arrayThis is the exact polygon for this entitye.

Definition at line 125 of file LGV_TZ_Lookup_Loader.class.php.

◆ _process_entity()

LGV_TZ_Lookup_Loader::_process_entity ( $inEntity)
staticprivate

This processes one new entity, after we have parsed it.

Parameters
$inEntityThe new entity to be processed.

Definition at line 96 of file LGV_TZ_Lookup_Loader.class.php.

Referenced by listener_action().

Here is the caller graph for this function:

◆ _update_coords()

LGV_TZ_Lookup_Loader::_update_coords ( $current,
$next )
staticprivate

This function simply compares the given long ([0], and lat ([1]) against the current values, and extends an edge, if necessary.

This is designed to be a reduce handler, with the current value, and the new value, passed in, returning a new current value.

Returns
a new domain rect, as an associative array.
Parameters
$currentThis is the current domain rect. It contains the maximums for East, West, North, and South, in an associative array.
$nextThis is the next value of the long lat. It is a simple 2-element floating point array, with [0] being the longitude, and [1] being the latitude.

Definition at line 109 of file LGV_TZ_Lookup_Loader.class.php.

◆ listener_action()

LGV_TZ_Lookup_Loader::listener_action ( $inItem)
static

This is the action that is called by the JSON streamer.

Parameters
$inItemThe element of the JSON file being parsed. This is one geographic area for the time zone.

Definition at line 79 of file LGV_TZ_Lookup_Loader.class.php.

References _process_entity().

Here is the call graph for this function:

Member Data Documentation

◆ $db_object

LGV_TZ_Lookup_Loader::$db_object
static

The database object we're accessing. It's static, because that makes it easy to get in the callback.

Definition at line 60 of file LGV_TZ_Lookup_Loader.class.php.


The documentation for this class was generated from the following file: