Antidot PHP API  version 0.16.0
##PHP API to simplify integration of Antidot components
 All Classes Files Functions Variables Groups Pages
Public Member Functions | List of all members
AfsClientDataManager Class Reference

Manage client data. More...

Public Member Functions

 __construct ($client_datas)
 Construct new manager with all necessary client data helpers.
 get_clientdata ($id='main')
 Retrieves client data helper.
 get_value ($id, $name=null, $context=array(), $formatter=null)
 Retrieves value from the appropriate client data.
 get_values ($id, $name=null, $context=array(), $formatter=null)
 Retrieves value(s) from the appropriate client data.

Detailed Description

Manage client data.

Instances of this class allow to manage one or more XML and JSON client data.

Constructor & Destructor Documentation

__construct (   $client_datas)

Construct new manager with all necessary client data helpers.

One or more client data helper can be created and managed.

Parameters
$client_datas[in] root of client data element.

Member Function Documentation

get_clientdata (   $id = 'main')

Retrieves client data helper.

Parameters
$id[in] Id of the client data to retrieve (default='main').
Returns
client data helper.
Exceptions
OutOfBoundsExceptionwhen required client data is not found.
get_value (   $id,
  $name = null,
  $context = array(),
  $formatter = null 
)

Retrieves value from the appropriate client data.

Parameters
$id[in] client data id.
$name[in] name or XPath of the required element for JSON respectively XML client data.
$context[in] context used to look for text with specified name.
$formatter[in] used for highlighted content (default=null, appropriate formatter is instanced for JSON and XML).
Returns
client data as text.
get_values (   $id,
  $name = null,
  $context = array(),
  $formatter = null 
)

Retrieves value(s) from the appropriate client data.

Parameters
$id[in] client data id.
$name[in] name or XPath of the required element for JSON respectively XML client data.
$context[in] context used to look for text with specified name.
$formatter[in] used for highlighted content (default=null, appropriate formatter is instanced for JSON and XML).
Returns
client data as text.