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

Helper representing one suggestion reply. More...

Inheritance diagram for AfsAcpReplyHelper:
AfsHelperBase

Public Member Functions

 __construct ($suggestion, $meta, AfsAcpConfiguration $config=null)
 Constructs new ACP suggestion helper.
 get_value ()
 Retrieves suggestion value.
 get_search_query ()
 Gets AFS search query associated to this suggestion value.
Meta data
 has_option ($name=null)
 Checks whether mete data (options) are available.
 get_option ($name)
 Retrieves specified meta data.
 get_options ()
 Retrieves all meta data associated to current suggestion value.
Miscellaneous
 format ()
 Retrieves suggestions as array.
- Public Member Functions inherited from AfsHelperBase
 __get ($name)
 Simple property helper.

Detailed Description

Helper representing one suggestion reply.

This class is not intended to be instanciated manually.

Constructor & Destructor Documentation

__construct (   $suggestion,
  $meta,
AfsAcpConfiguration  $config = null 
)

Constructs new ACP suggestion helper.

Parameters
$suggestion[in] Suggestion value.
$meta[in] Meta data associated to the suggestion value (may be null).
$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:

  • value: suggestion value,
  • options: map of meta data key-value pairs.
Returns
array filled with key and values.
get_option (   $name)

Retrieves specified meta data.

Parameters
$name[in] name of the requested meta data.
Returns
meta data.
Exceptions
OutOfBoundsExceptionwhen requested meta data is unavailable.
get_options ( )

Retrieves all meta data associated to current suggestion value.

Returns
meta data as key-value pairs.
get_search_query ( )

Gets AFS search query associated to this suggestion value.

AFS search query is initialized with appropriate search word and from parameter is set to AfsOrigin::ACP.

Returns
AFS search query.
get_value ( )

Retrieves suggestion value.

Returns
value of the suggestion.
has_option (   $name = null)

Checks whether mete data (options) are available.

Parameters
$name[in] name of meta data to check. Default is null to test whether at least one meta data is available.
Returns
true when required meta data is present or least one meta data is available, false otherwise.