\FACTFinder\AdapterTagCloud

Base class for all adapters. An adapter is a class that configures a request to some FACT-Finder action and transforms the result into useful domain objects (usually objects of classes from the \Data namespace).

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()
getTagCloud()
setWordCount()
No public properties found
No constants found
usePassthroughResponseContentProcessor()
useJsonResponseContentProcessor()
useXmlResponseContentProcessor()
useResponseContentProcessor()
getResponseContent()
convertServerQueryToClientUrl()
isValidResponse()
$configuration
$request
$parameters
$urlBuilder
$upToDate
N/A
createTagCloud()
$log
$responseContentProcessor
$lastResponse
$responseContent
$error
$stackTrace
$tagCloud
$lastRequestQuery
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.

$tagCloud

$tagCloud : array<mixed,\FACTFinder\Adapter\FACTFinder\Data\TagQuery>

Type

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

$lastRequestQuery

$lastRequestQuery : string

Type

string

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

getTagCloud()

getTagCloud(  $requestQuery = null) : array<mixed,\FACTFinder\Adapter\FACTFinder\Data\TagQuery>

Get the tag cloud from FACT-Finder as an array of TagQuery's.

Parameters

$requestQuery

Returns

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

setWordCount()

setWordCount(integer  $wordCount) 

Set the maximum amount of tag queries to be fetched.

Parameters

integer $wordCount

The number of tag queries to be fetched. Something else than a positive integer is passed, the word count will be unlimited (or determined by FACT-Finder).

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

createTagCloud()

createTagCloud(  $requestQuery = null) 

Parameters

$requestQuery