\FACTFinder\AdapterConfigurableResponse

Base class for all adapters which support the response of records with ids only.

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()
setIdsOnly()
No public properties found
No constants found
usePassthroughResponseContentProcessor()
useJsonResponseContentProcessor()
useXmlResponseContentProcessor()
useResponseContentProcessor()
getResponseContent()
convertServerQueryToClientUrl()
isValidResponse()
$configuration
$request
$parameters
$urlBuilder
$upToDate
$idsOnly
N/A
No private methods found
$log
$responseContentProcessor
$lastResponse
$responseContent
$error
$stackTrace
N/A

Properties

$parameters

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

Type

\FACTFinder\Adapter\FACTFinder\Util\Parameters

$upToDate

$upToDate : boolean

Type

boolean

$idsOnly

$idsOnly : boolean

Type

boolean

$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.

Methods

__construct()

__construct(string  $loggerClass, \FACTFinder\Core\ConfigurationInterface  $configuration, \FACTFinder\Core\Server\Request  $request, \FACTFinder\Core\Client\UrlBuilder  $urlBuilder, \FACTFinder\Core\encodingConverter  $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\encodingConverter $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

setIdsOnly()

setIdsOnly(  $idsOnly) 

Set this to true to only retrieve the IDs of products instead of full Record objects.

Parameters

$idsOnly

bool

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