$sid
$sid : string
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.
$configuration : \FACTFinder\Core\ConfigurationInterface
$request : \FACTFinder\Core\Server\Request
$urlBuilder : \FACTFinder\Core\Client\UrlBuilder
$lastResponse : \FACTFinder\Core\Server\Response
__construct(string $loggerClass, \FACTFinder\Core\ConfigurationInterface $configuration, \FACTFinder\Core\Server\Request $request, \FACTFinder\Core\Client\UrlBuilder $urlBuilder, \FACTFinder\Core\AbstractEncodingConverter $encodingConverter = null)
| 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 |
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.
| string|array<mixed,string> | $productNumbers | One or more product numbers. |
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.
getRawProductCampaigns(string $format = null, string $callback = null) : string
Get the product campaigns from FACT-Finder as the string returned by the server.
| 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. |
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.
| object | $callable | A function (or invokable object) that processes a single string parameter. |
if $callable is not callable.
fillCampaignWithFeedback(\FACTFinder\Data\Campaign $campaign, array<mixed,mixed> $campaignData)
| \FACTFinder\Data\Campaign | $campaign | The campaign object to be filled. |
| array<mixed,mixed> | $campaignData | An associative array corresponding to the JSON for that campaign. |
createEmptyCampaignObject(array<mixed,mixed> $campaignData) : \FACTFinder\Data\Campaign
| array<mixed,mixed> | $campaignData | An associative array corresponding to the JSON for a single campaign. |
fillCampaignWithPushedProducts(\FACTFinder\Data\Campaign $campaign, array<mixed,mixed> $campaignData)
| \FACTFinder\Data\Campaign | $campaign | The campaign object to be filled. |
| array<mixed,mixed> | $campaignData | An associative array corresponding to the JSON for that campaign. |