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

Main helper for AFS ACP reply. More...

Inheritance diagram for AfsAcpResponseHelper:
AfsResponseHelperBase

Public Member Functions

 __construct ($response, AfsAcpConfiguration $config=null)
 Constructs new ACP response helper.
 get_query_string ()
 Retrieves query string.
Replies
 has_replyset ()
 Checks whether there is suggestion.
 get_replysets ()
 Retrieves all suggestions from all feeds.
 get_replyset ($feed='')
 Retrieves suggestions from specific feed.
Miscellaneous
 format ()
 Retrieves suggestions as array.
- Public Member Functions inherited from AfsResponseHelperBase
 in_error ()
 Check whether an error has been raised.
 get_error_msg ()
 Retrieve error message.

Additional Inherited Members

- Protected Member Functions inherited from AfsResponseHelperBase
 set_error_msg ($msg)

Detailed Description

Main helper for AFS ACP reply.

This helper is intended to be initialized with reply from AfsAcpQueryManager::send. It allows to manage suggestions from one or more feeds.

Constructor & Destructor Documentation

__construct (   $response,
AfsAcpConfiguration  $config = null 
)

Constructs new ACP response helper.

Parameters
$response[in] Json decoded reply.
$config[in] ACP configuration.

Member Function Documentation

format ( )

Retrieves suggestions as array.

This method is intended for internal use only.

All data are stored in key => value format:

  • feed name: suggestions per feed, Or, in case of error:
  • error: error message.
Returns
array filled with key and values.
get_query_string ( )

Retrieves query string.

Returns
query string.
get_replyset (   $feed = '')

Retrieves suggestions from specific feed.

Parameters
$feed[in] name of the feed to filter on (default: empty string -> retrieves generic spellcheck if any, otherwise raise exception)
Returns
AfsReplysetHelper or formatted replyset depending on format parameter.
Exceptions
OutOfBoundsExceptionwhen required feed does not exist. This also happen when no feed name is provided whereas all suggestions are associated to named feeds.
get_replysets ( )

Retrieves all suggestions from all feeds.

Map of suggestions where the key corresponds to the name of feed which has generated suggestions and the value corresponds to suggestion helper.

Returns
all defined suggestions per feed.
has_replyset ( )

Checks whether there is suggestion.

Returns
true when at least one suggestion is available, false otherwise.