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

$isShoppingCartCampaign

$isShoppingCartCampaign : boolean

Type

boolean

$isLandingPageCampaign

$isLandingPageCampaign : 

Type

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

$campaigns

$campaigns : \FACTFinder\Adapter\FACTFinder\Data\Result

Type

\FACTFinder\Adapter\FACTFinder\Data\Result

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

setProductNumbers()

setProductNumbers(string|array<mixed,string>  $productNumbers) 

Set one or multiple product numbers to get campaigns for, overwriting any numbers previously set. Note that multiple numbers will only be considered for shopping cart campaigns. For product detail campaigns only the first number will be used.

Parameters

string|array<mixed,string> $productNumbers

One or more product numbers.

addProductNumbers()

addProductNumbers(string|array<mixed,string>  $productNumbers) 

Add one or multiple product numbser to get campaigns for, in addition to any numbers previously set.

Parameters

string|array<mixed,string> $productNumbers

One or more product numbers.

setPageId()

setPageId(string  $pageId) 

Set the page id to get landing page campaigns.

Parameters

string $pageId

The id which determines the campaigns for a page.

makeProductCampaign()

makeProductCampaign() 

Sets the adapter up for fetching campaigns on product detail pages

makeShoppingCartCampaign()

makeShoppingCartCampaign() 

Sets the adapter up for fetching campaigns on shopping cart pages

makePageCampaign()

makePageCampaign() 

Sets the adapter up for fetching campaigns on landing pages

getCampaigns()

getCampaigns() : \FACTFinder\Data\Result

Returns campaigns for IDs previously specified. If no IDs have been set, there will be a warning raised and an empty result will be returned.

Returns

\FACTFinder\Data\Result

getRawProductCampaigns()

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

Get the product campaigns 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

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.

createCampaigns()

createCampaigns() 

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

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.