AbstractConsumerMiddleware
extends AbstractMiddleware
in package
Abstract implementation of a middleware for consumer life cycles.
Table of Contents
Properties
- $consumer : mixed
- $suspended : mixed
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.
- applyAcknowledgementMode() : mixed
- Disallow the creation of a service in the scanner. Additionally, you can add a message to the consumer data which is shown to the user. The user can only acknowledge to the message and not create the service.
Properties
$consumer
private
mixed
$consumer
$suspended
private
mixed
$suspended
= false
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
abstract afterDownloadAndPersistFromDataSource(Exception $exception, array<string|int, AbstractTemplate> $templates) : void
Parameters
- $exception : Exception
-
null
when persist worked as expected, otherwise anException
- $templates : array<string|int, AbstractTemplate>
-
The persisted templates within this consumer
afterUseTemplate()
Teardown of `beforeDownloadAndPersistFromDataSource`.
public
abstract afterUseTemplate(AbstractTemplate $template) : void
Parameters
- $template : AbstractTemplate
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
abstract beforeDownloadAndPersistFromDataSource() : void
beforeUseTemplate()
Before using a template and running all the middlewares of `AbstractTemplateMiddleware`.
public
abstract beforeUseTemplate(AbstractTemplate $template) : void
Parameters
- $template : AbstractTemplate
failedDownloadAndPersistFromDataSource()
The download from a data source failed with an exception.
public
failedDownloadAndPersistFromDataSource(Exception $exception) : void
Parameters
- $exception : Exception
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
applyAcknowledgementMode()
Disallow the creation of a service in the scanner. Additionally, you can add a message to the consumer data which is shown to the user. The user can only acknowledge to the message and not create the service.
protected
applyAcknowledgementMode(AbstractTemplate $template[, array<string|int, string> $paragraphs = [] ][, array<string|int, string> $accordion = null ][, string $buttonLabel = null ][, string $buttonAction = null ]) : mixed
Parameters
- $template : AbstractTemplate
- $paragraphs : array<string|int, string> = []
- $accordion : array<string|int, string> = null
-
A list of accordions with key as headline and value as message.
- $buttonLabel : string = null
-
The label of the button.
- $buttonAction : string = null
-
The action of the button, can be "ignore", "create" or "close".