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
AfsTextManager Class Reference

Title and content text manager. More...

Public Member Functions

 __construct (array $json_reply)
 Construct text manager instance.
 visit_text (AfsTextVisitorInterface $visitor)
 Visit all text entries.
 get_texts ()
 Retrieves all text entries.

Detailed Description

Title and content text manager.

Provided a JSON result, this manager allows simple way to present result title or result content.

Constructor & Destructor Documentation

__construct ( array  $json_reply)

Construct text manager instance.

Each portion of text (text, match and truncate) is extracted from input parameter and stored with appropriate text type.
Two methods are available to traverse these portions of text:

  • visit_text method using predefined visitor (AfsTextVisitor) or user defined visitor. This is the prefered method.
  • get_texts method which returns an array of AfsText (or one of its derived class) instances.
Parameters
$json_reply[in] corresponds to one title or abstract reply in JSON format.
Exceptions
Exceptionwhen provided json_reply parameter is invalid.

Member Function Documentation

get_texts ( )

Retrieves all text entries.

Returns
array of AfsText or one of its derived class.
visit_text ( AfsTextVisitorInterface  $visitor)

Visit all text entries.

Parameters
$visitor[in] Visitor used to traverse all text entries.
Returns
concatenated text from visited text entries.