ConsumerMiddleware
extends AbstractConsumerMiddleware
in package
Consumer middleware for both service and blocker templates.
Table of Contents
Properties
- $consumer : mixed
- $suspended : mixed
- $td : TemporaryTextDomain
- Temporary text domain.
Methods
- __construct() : mixed
- C'tor.
- afterDownloadAndPersistFromDataSource() : void
- Teardown of `beforeDownloadAndPersistFromDataSource`. This is also invoked when the database throws the `AbortDataSourceDownloadException` exception.
- afterUseTemplate() : void
- Teardown of `beforeDownloadAndPersistFromDataSource`.
- beforeDownloadAndPersistFromDataSource() : void
- Before downloading from specified datasources. This allows you to e.g. change the language of the context to make translations work as expected.
- beforeUseTemplate() : void
- Before using a template and running all the middlewares of `AbstractTemplateMiddleware`.
- failedDownloadAndPersistFromDataSource() : void
- The download from a data source failed with an exception.
- getConsumer() : mixed
- Getter.
- getVariableResolver() : mixed
- Getter.
- isSuspended() : mixed
- Check if the middleware is suspended.
- suspend() : mixed
- Allows to suspend or resume the middleware to take effect. This is efficient if a middleware could be called recursively.
- setRetryIn() : mixed
- Set the retry-in variable in all available consumers within the consumer pools.
Properties
$consumer
private
mixed
$consumer
$suspended
private
mixed
$suspended
= false
$td
Temporary text domain.
private
TemporaryTextDomain
$td
Methods
__construct()
C'tor.
public
__construct(ServiceCloudConsumer $consumer) : mixed
Parameters
- $consumer : ServiceCloudConsumer
afterDownloadAndPersistFromDataSource()
Teardown of `beforeDownloadAndPersistFromDataSource`. This is also invoked when the database throws the `AbortDataSourceDownloadException` exception.
public
afterDownloadAndPersistFromDataSource(mixed $exception) : void
Parameters
- $exception : mixed
-
null
when persist worked as expected, otherwise anException
afterUseTemplate()
Teardown of `beforeDownloadAndPersistFromDataSource`.
public
afterUseTemplate(mixed $template) : void
Parameters
- $template : mixed
beforeDownloadAndPersistFromDataSource()
Before downloading from specified datasources. This allows you to e.g. change the language of the context to make translations work as expected.
public
beforeDownloadAndPersistFromDataSource() : void
beforeUseTemplate()
Before using a template and running all the middlewares of `AbstractTemplateMiddleware`.
public
beforeUseTemplate(mixed $template) : void
Parameters
- $template : mixed
failedDownloadAndPersistFromDataSource()
The download from a data source failed with an exception.
public
failedDownloadAndPersistFromDataSource(mixed $exception) : void
Parameters
- $exception : mixed
getConsumer()
Getter.
public
getConsumer() : mixed
Tags
getVariableResolver()
Getter.
public
getVariableResolver() : mixed
Tags
isSuspended()
Check if the middleware is suspended.
public
isSuspended() : mixed
suspend()
Allows to suspend or resume the middleware to take effect. This is efficient if a middleware could be called recursively.
public
suspend(bool $state) : mixed
Parameters
- $state : bool
setRetryIn()
Set the retry-in variable in all available consumers within the consumer pools.
protected
setRetryIn(mixed $value) : mixed
Parameters
- $value : mixed