\DefaultTrackingStore
This is a default implementation of the tracking store. It is a "poor man's" implementation that should be suitable for simple installations where the number of users and/or the number of tracked items is not too large.
The querying functions are fairly basic, and probably not too performant.
Synopsis
class DefaultTrackingStore
implements
TrackingStore
{
- // members
- public static array $property_ids = ;
- protected static array $supported_functions = ;
- public static array $periods = ;
- // methods
- public void init()
- public void getProperties()
- public void setProperties()
- public void getPropertyID()
- public array getMetadata()
- public non-null query()
- protected void executeFunction()
- protected void executeFnGetEvents()
- protected void executeFnCountByTime()
- public static void _escape()
- public static void json_encode_typed()
- public static void json_decode_typed()
- public static void json_decode_typed_normalise()
Hierarchy
Implements
Tasks
Line | Task |
---|---|
89+ | the following examples are not correct now that we've switched to ContextProperty as the return type. Examples: getProperties("profile.segment") might return: array( "profile.segment" => "wealthy-rural" ) getProperties(array("profile.segment", "profile.region")) might return: array( "profile.segment" => "wealth-rural", "profile.region" => "taranaki" ) (assuming that the store contains values for both properties.) getProperties( array("profile.region" => array( "multiple" => true )) ) might return: array( "profile.region" => array( "taranaki", // most recent first "manawatu", "canterbury" ) ) getProperties( array("profile.region" => array( "multiple" => true, "metadata" => true )) ) might return: array( "profile.region" => array( array( "value" => "taranaki", "timestamp" => 342423424 ), array( "value" => "manawatu", "timestamp" => 324134534 ), array( "value" => "canterbury", "timestamp" => 312532243 ) ) ) Metadata properties may vary by tracking store. The only defined key in the result item is "value". |
Members
protected
- $supported_functions
public
- $periods
—
array
Map of period names to the number of seconds used for grouping. - $property_ids
—
array
Per-request cache of properties we've mapped from name to ID.
Methods
protected
- executeFnCountByTime() — Given a set of events, group them by time and count them. Returns an array of maps with "time" and "count" properties.
- executeFnGetEvents() — Retrieve a list of events that is filtered by something. Params may include: - startTime - timestamp of start of date range - endTime - timestamp of end of date range - property - property name, or array of property names, to filter to.
- executeFunction()
public
- _escape()
- getMetadata() — Retrieve metadata for the specified namespace(s). Returns a map of property name to data type.
- getProperties()
- getPropertyID() — Given a property name, return the ID of the DefaultTrackingStoreProperty. This used in querying items, which only store the IDs.
- init()
- json_decode_typed()
- json_decode_typed_normalise()
- json_encode_typed()
- query()
- setProperties()