class Responder implements ResponderInterface (View source)

Responder is responsible for processing the transaction.

It invokes the finder and creator, and handles the caching logic.

Properties

protected CreatorInterface $creator
protected FinderInterface $finder
protected Image $errorImage
protected FilesystemInterface|null $webFs
protected Cache $cache
protected int|null $cacheTime

Methods

__construct(CreatorInterface $creator, FinderInterface $finder, Image $errorImage, FilesystemInterface $webFs = null, Cache $cache = null, int $cacheTime)

Responder constructor.

respond(Transaction $transaction)

Process the transaction and return a thumbnail.

string
getThumbnail(Transaction $transaction)

Returns thumbnail data for the given transaction.

saveStaticThumbnail(string $requestPath, string $imageContent)

Saves a static copy of the thumbnail to the web folder.

Details

__construct(CreatorInterface $creator, FinderInterface $finder, Image $errorImage, FilesystemInterface $webFs = null, Cache $cache = null, int $cacheTime)

Responder constructor.

Parameters

CreatorInterface $creator
FinderInterface $finder
Image $errorImage
FilesystemInterface $webFs
Cache $cache
int $cacheTime

Thumbnail respond(Transaction $transaction)

Process the transaction and return a thumbnail.

Parameters

Transaction $transaction

Return Value

Thumbnail

protected string getThumbnail(Transaction $transaction)

Returns thumbnail data for the given transaction.

Handles the cache layer around the creation as well.

Parameters

Transaction $transaction

Return Value

string

protected saveStaticThumbnail(string $requestPath, string $imageContent)

Saves a static copy of the thumbnail to the web folder.

Parameters

string $requestPath
string $imageContent