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

Manages one or more spellcheck reply. More...

Inheritance diagram for AfsSpellcheckManager:
AfsHelperBase

Public Member Functions

 __construct (AfsQuery $query, AfsHelperConfiguration $config)
 Constructs new manager instance.
 add_spellcheck ($replyset)
 Add new spellcheck reply to spellcheck manager.
 has_spellcheck ()
 Checks whether at least one spellcheck is defined.
 get_spellcheck ($feed=null)
 Retrieves default, available or specified spellcheck.
 get_spellchecks ()
 Retrieves all spellcheck replies.
 format ()
 Retrieves spellchecks as array.
- Public Member Functions inherited from AfsHelperBase
 __get ($name)
 Simple property helper.

Detailed Description

Manages one or more spellcheck reply.

Constructor & Destructor Documentation

__construct ( AfsQuery  $query,
AfsHelperConfiguration  $config 
)

Constructs new manager instance.

Parameters
$query[in] the query which has generated current reply.
$config[in] helper configuration.

Member Function Documentation

add_spellcheck (   $replyset)

Add new spellcheck reply to spellcheck manager.

Parameters
$replyset[in] JSON reply corresponding to a spellcheck reply.
Exceptions
Exceptionwhen invalid replyset has been provided.
format ( )

Retrieves spellchecks as array.

All data are store in key => value format:

  • key corresponds to the feed name or default spellcheck name (see AFS_DEFAULT_SPELLCHECK)
  • value corresponds to spellcheck result (see AfsSpellcheckHelper::format).
get_spellcheck (   $feed = null)

Retrieves default, available or specified spellcheck.

Parameters
$feed[in] Feed for which spellcheck should be retrieved. Default value is null, two cases can occur:
  • there is only one spellcheck reply which is returned,
  • there is multiple spellcheck replies and one corresponds to default spellcheck reply (AFS_DEFAULT_SPELLCHECK); this one is returned.
Returns
spellcheck helper (see AfsSpellcheckHelper).
Exceptions
OutOfBoundsExceptionwhen required feed has not produced any spellcheck reply.
get_spellchecks ( )

Retrieves all spellcheck replies.

Returns
spellcheck replies.
has_spellcheck ( )

Checks whether at least one spellcheck is defined.

Returns
True when one or more spellcheck is defined, false otherwise.