\FACTFinder\AdapterSuggest

TODO: Are there any other FF 6.8 features left which we are not making use of yet? If so: change that.

The adapter classes could conceivably be placed in the \Core\Server namespace, but that would potentially discourage fiddling with and extending these classes. The adapters are main components of the external API of this library. Most other classes are just used to make the adapters work.

Summary

Methods
Properties
Constants
__construct()
getError()
getStackTrace()
getSuggestions()
getRawSuggestions()
No public properties found
No constants found
usePassthroughResponseContentProcessor()
useJsonResponseContentProcessor()
useXmlResponseContentProcessor()
useResponseContentProcessor()
getResponseContent()
convertServerQueryToClientUrl()
isValidResponse()
$configuration
$request
$parameters
$urlBuilder
$upToDate
N/A
createSuggestions()
$log
$responseContentProcessor
$lastResponse
$responseContent
$error
$stackTrace
$suggestions
N/A

Properties

$parameters

$parameters : \FACTFinder\Adapter\FACTFinder\Util\Parameters

Type

\FACTFinder\Adapter\FACTFinder\Util\Parameters

$upToDate

$upToDate : boolean

Type

boolean

$log

$log : \FACTFinder\Adapter\FACTFinder\Util\LoggerInterface

Type

\FACTFinder\Adapter\FACTFinder\Util\LoggerInterface

$responseContentProcessor

$responseContentProcessor : \FACTFinder\Util\ContentProcessorInterface

Type

\FACTFinder\Util\ContentProcessorInterface

$responseContent

$responseContent : object

Type

object — The processed response content.

$error

$error : string

Type

string — The last error message.

$stackTrace

$stackTrace : string

Type

string — The last stack trace.

$suggestions

$suggestions : array<mixed,\FACTFinder\Adapter\FACTFinder\Data\SuggestQuery>

Type

array<mixed,\FACTFinder\Adapter\FACTFinder\Data\SuggestQuery>

Methods

__construct()

__construct(string  $loggerClass, \FACTFinder\Core\ConfigurationInterface  $configuration, \FACTFinder\Core\Server\Request  $request, \FACTFinder\Core\Client\UrlBuilder  $urlBuilder, \FACTFinder\Core\AbstractEncodingConverter  $encodingConverter = null) 

Parameters

string $loggerClass

Class name of logger to use. The class should implement FACTFinder\Util\LoggerInterface.

\FACTFinder\Core\ConfigurationInterface $configuration

Configuration object to use.

\FACTFinder\Core\Server\Request $request

The request object from which to obtain the server data.

\FACTFinder\Core\Client\UrlBuilder $urlBuilder

Client URL builder object to use.

\FACTFinder\Core\AbstractEncodingConverter $encodingConverter

Encoding converter object to use

getError()

getError() : string

Returns a message if an error occurred.

Returns

string

getStackTrace()

getStackTrace() : string

Returns the stack trace if an error occurred.

Returns

string

getSuggestions()

getSuggestions() : array<mixed,\FACTFinder\Adapter\FACTFinder\Data\SuggestQuery>

Get the suggestions from FACT-Finder as an array of SuggestQuery's.

Returns

array<mixed,\FACTFinder\Adapter\FACTFinder\Data\SuggestQuery>

getRawSuggestions()

getRawSuggestions(string  $format = null, string  $callback = null) : string

Get the suggestions from FACT-Finder as the string returned by the server.

Parameters

string $format

Optional. Either 'json' or 'jsonp'. Use to overwrite the 'format' parameter.

string $callback

Optional name to overwrite the 'callback' parameter, which determines the name of the callback the response is wrapped in.

Returns

string

usePassthroughResponseContentProcessor()

usePassthroughResponseContentProcessor() 

useJsonResponseContentProcessor()

useJsonResponseContentProcessor() 

useXmlResponseContentProcessor()

useXmlResponseContentProcessor() 

useResponseContentProcessor()

useResponseContentProcessor(object  $callable) 

Pass in a function to process the response content. This method is not used within the library, but may be convenient when writing custom adapters.

Parameters

object $callable

A function (or invokable object) that processes a single string parameter.

Throws

\FACTFinder\Adapter\InvalidArgumentException

if $callable is not callable.

getResponseContent()

getResponseContent() 

convertServerQueryToClientUrl()

convertServerQueryToClientUrl(  $query) 

Parameters

$query

isValidResponse()

isValidResponse(  $jsonData) : boolean

Returns true if the response is valid or false if an error occurred.

Parameters

$jsonData

Returns

boolean

createSuggestions()

createSuggestions()