DeviceAtlas Device API
 All Classes Namespaces Functions Variables
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Mobi_Mtld_DA_PostWalkRules Class Reference
Inheritance diagram for Mobi_Mtld_DA_PostWalkRules:
Mobi_Mtld_DA_ClientProps Mobi_Mtld_DA_UaProps

Public Member Functions

 __construct (array &$tree, $type)
 propIsOutput ($propertyId)
 getRequiredProperties ()

Public Attributes

const RULE_GROUPS = "rg"
const PROPERTY_MATCHER = "p"
const PROPERTY = "p"
const PROPERTY_VALUE = "v"
const OPERATOR = "o"
const RULE_ARR = "r"
const RULE_PROP_IDS_IN_USE = "rpids"
const MATCHER_PROP_IDS_IN_USE = "mpids"
const RULE_SET = "t"
const RULE_SET_COUNT = "tc"

Protected Member Functions

 _initGetMatcherPropertyIds ($group, $propIds)
 _initRuleSets ($group)

Protected Attributes

 $tree
 $branch
 $propertyNameToId
 $propertyIdToType

Detailed Description

This class is used by the main Api class and should not be used directly.

This class tries to extract properties from the User-Agent string itself. This is a completely separate step to the main JSON tree walk but uses the results of the tree walk to optimise the property extraction. The property extraction is done in two steps.

Step 1: Try and identify the type of User-Agent and thus the set of property extraction rules to run. This is optimised by the properties from the tree walk.

Step 2: Run the rules found in step 1 to try and extract the properties.

Author
dotMobi

Member Function Documentation

Mobi_Mtld_DA_PostWalkRules::_initGetMatcherPropertyIds (   $group,
  $propIds 
)
abstractprotected

Find all the properties that are used for matching. This is needed in case the Api.getProperty() function is called as we need these properties for the rules to work correctly

Parameters
array$groupThe rule group that can contain a property matcher
array$propIdsThe list of found property IDs
Returns
An updated set of property IDs

Reimplemented in Mobi_Mtld_DA_ClientProps, and Mobi_Mtld_DA_UaProps.

Mobi_Mtld_DA_PostWalkRules::_initRuleSets (   $group)
abstractprotected

Prepare the rule set

Parameters
array$groupThe current parent group.
Returns
A list of all rule sets

Reimplemented in Mobi_Mtld_DA_ClientProps, and Mobi_Mtld_DA_UaProps.

Mobi_Mtld_DA_PostWalkRules::getRequiredProperties ( )

Get a list of all the required properties that are needed for this class to properly run its rules.

structure:

$propertyId => 1

Used with $sought

Returns
The list of required properties.
Mobi_Mtld_DA_PostWalkRules::propIsOutput (   $propertyId)

Check if the property is used in the rules and so can be found from them. This is used in Api.getProperty() to avoid calling the methods in the class if the property that is being looked for cannot be found here.

Parameters
integer$propertyIdThe ID of the property that is sought
Returns
TRUE if the propertyId is used, FALSE otherwise

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