AbstractPoolMiddleware
extends AbstractMiddleware
in package
AbstractYes
Abstract implementation of a middleware for templates with a pool.
Table of Contents
Properties
- $consumer : mixed
- $suspended : mixed
Methods
- __construct() : mixed
- C'tor.
- afterPersistTemplatesWithinPool() : void
- After persisting all template instances within a pool.
- beforePersistTemplateWithinPool() : void
- Before persisting the template instance when all consumers within a pool got downloaded.
- 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.
Properties
$consumer
private
mixed
$consumer
$suspended
private
mixed
$suspended
= false
Methods
__construct()
C'tor.
public
__construct(ServiceCloudConsumer $consumer) : mixed
Parameters
- $consumer : ServiceCloudConsumer
afterPersistTemplatesWithinPool()
After persisting all template instances within a pool.
public
abstract afterPersistTemplatesWithinPool(array<string|int, ServiceCloudConsumer> $consumer, array<string|int, AbstractTemplate> &$typeClassToAllTemplates) : void
Parameters
- $consumer : array<string|int, ServiceCloudConsumer>
- $typeClassToAllTemplates : array<string|int, AbstractTemplate>
-
Key = type class, value = array of templates
beforePersistTemplateWithinPool()
Before persisting the template instance when all consumers within a pool got downloaded.
public
abstract beforePersistTemplateWithinPool(AbstractTemplate $template, array<string|int, AbstractTemplate> &$typeClassToAllTemplates) : void
Example: Calculate contentBlockerTemplates
for ServiceTemplate
.
Parameters
- $template : AbstractTemplate
- $typeClassToAllTemplates : array<string|int, AbstractTemplate>
-
Key = type class, value = array of templates
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