TOP

Mobi_Mtld_DA_Device_Tree

This class is used by the main API class and should not be used directly.
Package
Mobi\Mtld\DA\Device
Author
DeviceAtlas Limited

Methods

__construct

Mobi_Mtld_DA_Device_Tree $obj = new Mobi_Mtld_DA_Device_Tree()

Create the JSON tree handler.

Returns

void

getDataCreationTimestamp

void $obj->getDataCreationTimestamp()

Get data file creation timestamp

Returns

void

getDataVersion

void $obj->getDataVersion()

Get data file version

Returns

void

getLookupSource

string $obj->getLookupSource()

Get the source properties fetch source to be used for debugging.

Returns

string
'tree' or 'optimized tree' or 'cache'

getPropertyNames

void $obj->getPropertyNames()

Get the list of all available property names from the tree (not contains client side props)

Returns

void

loadTreeFromFile

void $obj->loadTreeFromFile()

Load the JSON tree file into the handler.

Returns

void

Throws

loadTreeFromString

void $obj->loadTreeFromString()

Load the JSON tree into the handler.

Returns

void

Throws

putProperties

void $obj->putProperties(userAgent user-agent, stockUserAgents list, clientside may)

Get properties from tree walk/ua/client-side and put them in the tree.properties

Arguments

    user-agent (userAgent)
    string (from the original User-Agent header) to be used for detecting ua-props
    list (stockUserAgents)
    of candidate user-agent strings to be used for tree walk
    may (clientside)
    be null

Returns

void

putTreeWalkProperties

void $obj->putTreeWalkProperties(userAgent user-agent, stockUserAgents list)

Get properties from tree walk/ua and put them in the tree.properties if stockUserAgents != null - iterate over stockUserAgents for each item: tree-walk and stop iteration if result has deviceId - use userAgent for detecting the ua-props if stockUserAgents == null - use userAgent for tree walk - use userAgent for detecting the ua-props

Arguments

    user-agent (userAgent)
    string (from the original User-Agent header)
    list (stockUserAgents)
    of candidate user-agent strings to be used for tree walk

Returns

void

setConfig

void $obj->setConfig(type $config)

Set new config settings via a new Config object.

Arguments

    $config (type)

Returns

void