\FACTFinder\AdapterSearch

Base class for all adapters which support the personalisation.

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()
setSid()
setIdsOnly()
getError()
getStackTrace()
setQuery()
getResult()
getSingleWordSearch()
getStatus()
getArticleNumberStatus()
isSearchTimedOut()
getAfterSearchNavigation()
getResultsPerPageOptions()
createResultsPerPageOptions()
getPaging()
getSorting()
getSortingItems()
getBreadCrumbTrail()
getCampaigns()
getFollowSearchValue()
No public properties found
No constants found
usePassthroughResponseContentProcessor()
useJsonResponseContentProcessor()
useXmlResponseContentProcessor()
useResponseContentProcessor()
getResponseContent()
convertServerQueryToClientUrl()
isValidResponse()
fillCampaignWithFeedback()
$sid
$idsOnly
$configuration
$request
$parameters
$urlBuilder
$upToDate
N/A
createResult()
createSingleWordSearch()
createAfterSearchNavigation()
createFilterGroup()
createFilter()
createSliderFilter()
createPaging()
createPageItem()
createSorting()
createSortingItems()
createBreadCrumbTrail()
createCampaigns()
createEmptyCampaignObject()
fillCampaignObject()
fillCampaignWithPushedProducts()
fillCampaignWithAdvisorData()
createAdvisorQuestion()
createAdvisorAnswer()
$log
$responseContentProcessor
$lastResponse
$responseContent
$error
$stackTrace
$result
$singleWordSearch
$afterSearchNavigation
$resultsPerPageOptions
$paging
$sorting
$sortingItems
$breadCrumbTrail
$campaigns
N/A

Properties

$sid

$sid : string

Type

string

$idsOnly

$idsOnly : boolean

Type

boolean

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

$result

$result : \FACTFinder\Adapter\FACTFinder\Data\Result

Type

\FACTFinder\Adapter\FACTFinder\Data\Result

$singleWordSearch

$singleWordSearch : array<mixed,\FACTFinder\Adapter\FACTFinder\Data\SingleWordSearchItem>

Type

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

$afterSearchNavigation

$afterSearchNavigation : \FACTFinder\Adapter\FACTFinder\Data\AfterSearchNavigation

Type

\FACTFinder\Adapter\FACTFinder\Data\AfterSearchNavigation

$resultsPerPageOptions

$resultsPerPageOptions : \FACTFinder\Adapter\FACTFinder\Data\ResultsPerPageOptions

Type

\FACTFinder\Adapter\FACTFinder\Data\ResultsPerPageOptions

$paging

$paging : \FACTFinder\Adapter\FACTFinder\Data\Paging

Type

\FACTFinder\Adapter\FACTFinder\Data\Paging

$sorting

$sorting : \FACTFinder\Adapter\FACTFinder\Data\Sorting

Type

\FACTFinder\Adapter\FACTFinder\Data\Sorting

$sortingItems

$sortingItems : \FACTFinder\Adapter\FACTFinder\Data\SortingItems

Type

\FACTFinder\Adapter\FACTFinder\Data\SortingItems

$breadCrumbTrail

$breadCrumbTrail : \FACTFinder\Adapter\FACTFinder\Data\BreadCrumbTrail

Type

\FACTFinder\Adapter\FACTFinder\Data\BreadCrumbTrail

$campaigns

$campaigns : \FACTFinder\Adapter\FACTFinder\Data\CampaignIterator

Type

\FACTFinder\Adapter\FACTFinder\Data\CampaignIterator

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

setSid()

setSid(string  $sessionId) 

Set the session id for personalization.

Parameters

string $sessionId

session id

setIdsOnly()

setIdsOnly(  $idsOnly) 

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

Parameters

$idsOnly

bool

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

setQuery()

setQuery(string  $query) 

Overwrite the query on the request.

Parameters

string $query

isSearchTimedOut()

isSearchTimedOut() : boolean

Returns

boolean

getFollowSearchValue()

getFollowSearchValue() : integer

Value for parameter "followSearch" for followups on initial search like filters, pagination, .

.. Either from search results searchParams, request parameters or from search results "simiFirstRecord". Returns 0 if no parameter "followSearch" could be acquired.

Returns

integer

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 search response is valid or false if an error occurred.

Parameters

$jsonData

Returns

boolean

fillCampaignWithFeedback()

fillCampaignWithFeedback(\FACTFinder\Data\Campaign  $campaign, array<mixed,mixed>  $campaignData) 

Parameters

\FACTFinder\Data\Campaign $campaign

The campaign object to be filled.

array<mixed,mixed> $campaignData

An associative array corresponding to the JSON for that campaign.

createFilterGroup()

createFilterGroup(array<mixed,mixed>  $groupData) : \FACTFinder\Data\FilterGroup

Parameters

array<mixed,mixed> $groupData

An associative array corresponding to the JSON for a single filter group.

Returns

\FACTFinder\Data\FilterGroup

createFilter()

createFilter(array<mixed,mixed>  $filterData) : \FACTFinder\Data\Filter

Parameters

array<mixed,mixed> $filterData

An associative array corresponding to the JSON for a single filter.

Returns

\FACTFinder\Data\Filter

createSliderFilter()

createSliderFilter(array<mixed,mixed>  $filterData) : \FACTFinder\Data\SliderFilter

Parameters

array<mixed,mixed> $filterData

An associative array corresponding to the JSON for a single slider filter.

Returns

\FACTFinder\Data\SliderFilter

createPageItem()

createPageItem(array<mixed,mixed>  $pageData = null) : \FACTFinder\Data\Item

Parameters

array<mixed,mixed> $pageData

An associative array corresponding to the JSON for a single page link.

Returns

\FACTFinder\Data\Item

createEmptyCampaignObject()

createEmptyCampaignObject(array<mixed,mixed>  $campaignData) : \FACTFinder\Data\Campaign

Parameters

array<mixed,mixed> $campaignData

An associative array corresponding to the JSON for a single campaign.

Returns

\FACTFinder\Data\Campaign

fillCampaignObject()

fillCampaignObject(\FACTFinder\Data\Campaign  $campaign, array<mixed,mixed>  $campaignData) 

Parameters

\FACTFinder\Data\Campaign $campaign

The campaign object to be filled.

array<mixed,mixed> $campaignData

An associative array corresponding to the JSON for that campaign.

fillCampaignWithPushedProducts()

fillCampaignWithPushedProducts(\FACTFinder\Data\Campaign  $campaign, array<mixed,mixed>  $campaignData) 

Parameters

\FACTFinder\Data\Campaign $campaign

The campaign object to be filled.

array<mixed,mixed> $campaignData

An associative array corresponding to the JSON for that campaign.

fillCampaignWithAdvisorData()

fillCampaignWithAdvisorData(\FACTFinder\Data\Campaign  $campaign, array<mixed,mixed>  $campaignData) 

Parameters

\FACTFinder\Data\Campaign $campaign

The campaign object to be filled.

array<mixed,mixed> $campaignData

An associative array corresponding to the JSON for that campaign.

createAdvisorQuestion()

createAdvisorQuestion(array<mixed,mixed>  $questionData, boolean  $recursive = false) 

Parameters

array<mixed,mixed> $questionData

An associative array corresponding to the JSON for a single advisor question.

boolean $recursive

If this is set the entire advisor tree below this question will be created. Otherwise, follow-up questions of answers are omitted.

createAdvisorAnswer()

createAdvisorAnswer(array<mixed,mixed>  $answerData, boolean  $recursive = false) 

Parameters

array<mixed,mixed> $answerData

An associative array corresponding to the JSON for a single advisor answer.

boolean $recursive

If this is set the entire advisor tree below the subquestion of this ansewr will be created as well.