![]() |
Antidot PHP API
version 0.16.0
##PHP API to simplify integration of Antidot components
|
Helper for client data in JSON format. More...
Public Member Functions | |
__construct ($client_data) | |
Construct new instance of JSON helper. | |
get_value ($path=null, $unused=array(), $visitor=null) | |
Retrieves text from JSON content. | |
get_values ($name=null, $unused=array(), $visitor=null) | |
Same result as get_value method. | |
get_nodes ($jpath=null, $unused=array()) | |
Retrieves full client data node (not only text) | |
get_node ($jpath=null, $unused=array()) | |
Retrieves full client data node (not only text) | |
get_mime_type () | |
Retrieve client data's mime type. | |
![]() | |
get_id () | |
Retrieve client data id. | |
![]() | |
__get ($name) | |
Simple property helper. |
Helper for client data in JSON format.
__construct | ( | $client_data | ) |
Construct new instance of JSON helper.
$client_data | [in] input data used to initialize the instance. |
Reimplemented from AfsClientDataHelperBase.
get_mime_type | ( | ) |
Retrieve client data's mime type.
Implements AfsClientDataHelperInterface.
get_node | ( | $jpath = null , |
|
$unused = array() |
|||
) |
Retrieves full client data node (not only text)
$jpath | [in] node name to be extracted |
$context | [in] context used for looking for node with specified name. |
AfsNoResultException |
Implements AfsClientDataHelperInterface.
get_nodes | ( | $jpath = null , |
|
$unused = array() |
|||
) |
Retrieves full client data node (not only text)
$jpath | [in] node name to be extracted |
$context | [in] context used for looking for node with specified name. |
AfsNoResultException |
Implements AfsClientDataHelperInterface.
get_value | ( | $path = null , |
|
$unused = array() , |
|||
$visitor = null |
|||
) |
Retrieves text from JSON content.
$name | [in] name of the first element to retrieve (default=null, all JSON content is returned as text). Empty string allows to retrieve text content correctly formatted when highlight is activated. |
$unused | Hum... |
$visitor | [in] instance of AfsTextVisitorInterface used to format appropriately text content when highlight has been activated (default=null, AfsTextVisitor is used). |
AfsNoResultException | when required JSON element is not defined. |
{ "clientData": [ { "contents": { "data": [ "afs:t": "KwicString", "text": "some text" ] }, "id": "data1", "mimeType": "application/json" } ] }Call to
get_text(null)
will return {"data":["afs:t":"KwicString","text":"some text"]}.
{ "clientData": [ { "contents": { "data": [ "afs:t": "KwicString", "text": "some text" ] }, "id": "data1", "mimeType": "application/json" } ] }Call to
get_text('data')
will return some text.
* { "clientData": [ { "contents": [ { "afs:t": "KwicString", "text": "some text" } ], "id": "data1", "mimeType": "application/json" } ] }Call to
get_text('')
will return some text.
Implements AfsClientDataHelperInterface.
get_values | ( | $name = null , |
|
$unused = array() , |
|||
$visitor = null |
|||
) |
Same result as get_value method.
$name | [in] name of the first element to retrieve (default=null, all JSON content is returned as text). Empty string allows to retrieve text content correctly formatted when highlight is activated. |
$unused | Hum... |
$visitor | [in] instance of AfsTextVisitorInterface used to format appropriately text content when highlight has been activated (default=null, AfsTextVisitor is used). |
AfsNoResultException | when required JSON element is not defined. |
Implements AfsClientDataHelperInterface.