Documentation

Mobi_Mtld_DA_Device_ClientProps extends Mobi_Mtld_DA_Device_PostWalkRules
in package

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

Tags
author

DeviceAtlas Limited

copyright

Copyright (c) DeviceAtlas Limited 2021. All Rights Reserved. https://deviceatlas.com

Table of Contents

CP_RULES  = 'cpr'
OPERATOR_EQUAL  = 1
OPERATOR_GREATER  = 4
OPERATOR_GREATER_OR_EQUAL  = 1 & 4
OPERATOR_LESS  = 2
OPERATOR_LESS_OR_EQUAL  = 1 & 2
OPERATOR_NOT_EQUAL  = 8
OPERATOR_UNKNOWN  = 0
$branch  : mixed
$cachedBooleanPropertyFalse  : mixed
$cachedBooleanPropertyTrue  : mixed
$treeProvider  : mixed
__construct()  : mixed
putProperties()  : mixed
Merge the tree walk properties with the client side properties and run any additional rules based on the client side and tree walk properties. The rules can define replacement or additional values for properties and can also provide a new User-Agent to be used for a second tree walk. This is typically a fake User-Agent mapped to a device that cannot normally be detected such as the various iPhone models.
_checkPropertiesMatch()  : mixed
This functions checks all the properties in the property matcher branch of this rule group. This branch contains a list of properties, their values and an operator to use for comparison. All must match for this function to return true.
_compareValues()  : bool
Compare two values that can be one of String, Boolean or Integer using the passed in operator.
_getRulesToRun()  : mixed
_operatorToConst()  : mixed
_parseClientSideProperties()  : mixed
Parse the client side properties string into Map {key: value,} Sets to the tree.properties and returns the properties as Map (it is needed)
_preProcessRules()  : mixed

Constants

OPERATOR_GREATER_OR_EQUAL

public mixed OPERATOR_GREATER_OR_EQUAL = 1 & 4

OPERATOR_LESS_OR_EQUAL

public mixed OPERATOR_LESS_OR_EQUAL = 1 & 2

OPERATOR_NOT_EQUAL

public mixed OPERATOR_NOT_EQUAL = 8

Properties

$cachedBooleanPropertyFalse

protected mixed $cachedBooleanPropertyFalse

$cachedBooleanPropertyTrue

protected mixed $cachedBooleanPropertyTrue

Methods

__construct()

public __construct(mixed $tree) : mixed
Parameters
$tree : mixed
Return values
mixed

putProperties()

Merge the tree walk properties with the client side properties and run any additional rules based on the client side and tree walk properties. The rules can define replacement or additional values for properties and can also provide a new User-Agent to be used for a second tree walk. This is typically a fake User-Agent mapped to a device that cannot normally be detected such as the various iPhone models.

public putProperties(string $clientSide, mixed &$treeProperties) : mixed
Parameters
$clientSide : string
$treeProperties : mixed
Return values
mixed

_checkPropertiesMatch()

This functions checks all the properties in the property matcher branch of this rule group. This branch contains a list of properties, their values and an operator to use for comparison. All must match for this function to return true.

private _checkPropertiesMatch(mixed $propertyMatchers, mixed &$treeProperties) : mixed

In reality the properties and values are indexes to the main property and value arrays.

Parameters
$propertyMatchers : mixed
$treeProperties : mixed
Return values
mixed

_compareValues()

Compare two values that can be one of String, Boolean or Integer using the passed in operator.

private _compareValues(string $detectedValue, string $expectedValue, string $operator, mixed $dataTypeId) : bool
Parameters
$detectedValue : string
$expectedValue : string
$operator : string
$dataTypeId : mixed
Return values
bool

_getRulesToRun()

private _getRulesToRun(mixed &$treeProperties) : mixed
Parameters
$treeProperties : mixed
Return values
mixed

_operatorToConst()

private static _operatorToConst(mixed $operator) : mixed
Parameters
$operator : mixed
Return values
mixed

_parseClientSideProperties()

Parse the client side properties string into Map {key: value,} Sets to the tree.properties and returns the properties as Map (it is needed)

private _parseClientSideProperties(mixed $clientSide, mixed &$treeProperties) : mixed

The clientSide is of the form: bjs.webGl:1|bjs.geoLocation:1|sdeviceAspectRatio:16/10|iusableDisplayHeight:1050 Each key:val part of clientSide is checked for sanity, if it looks not fine then that key:val will be ignored.

The first character of the property name is the type of the value.

Parameters
$clientSide : mixed
$treeProperties : mixed
Return values
mixed

_preProcessRules()

private _preProcessRules() : mixed
Return values
mixed

Search results