\ContextProvider
A ContextProvider is an object that can provide the decision making context for a selection provider. It lets the selection provider retrieve information from the request and possibly other components such as a tracker.
It does not directly understand identity; that is handled by a tracker. The representation of data returned from
a ContextProvider is the same as a tracking store; a namespaced property-value pair.
A ContextProvider can also provide metadata about the properties that are understood, so admin interfaces can
introspect what is queryable.
Synopsis
Methods
public
- getMetadata() — Return metadata about what's known. Returns a map associating property name to a DBField instance. The instance only has a default value, but it's class can be used to determine info about the class. This is esp the case with enums, which will have values enumerated. Instances are typically from this set: Boolean, Date, Datetime, Enum, Float, Int, Text (not Varchar)
- getProperties() — Given a set of property names, return their values. Behaviour is the same as for TrackingStore::getProperties, except that the tracker works out the identity. If a property is unknown or a value cannot be found that satisfies constraints of the request, no key of that property should be returned. If none of the properties can be found, an empty array is returned.