Documentation

VersionsMiddleware extends AbstractTemplateMiddleware
in package

Middleware to replace `consumerData['versions'] (number[])` with the template object when using.

It automatically omits the latest version from the array.

Table of Contents

Properties

$resolvedVersions  : array<string|int, array<string|int, mixed>>
Prefetched version templates by request key (`identifier|version,version,...`).

Methods

__construct()  : mixed
C'tor.
beforePersistTemplate()  : void
Before persisting the template instance to the storage we can modify it.
beforeRetrievingTemplate()  : void
Before the template got read through `retrieve` or `retrieveBy`.
beforeUsingTemplate()  : void
Before using the template (e.g. expose it to the frontend UI form) we can modify it.
beforeUsingTemplates()  : void
Before using templates (e.g. expose them to the frontend UI form) we can modify them in batch.
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.
getNormalizedVersions()  : array<string|int, int>
Normalize available versions for a template usage context.
getRequestKey()  : mixed
Build request cache key for an identifier and versions.

Properties

$resolvedVersions

Prefetched version templates by request key (`identifier|version,version,...`).

private array<string|int, array<string|int, mixed>> $resolvedVersions = []

Methods

beforePersistTemplate()

Before persisting the template instance to the storage we can modify it.

public beforePersistTemplate(mixed $template, mixed &$allTemplates) : void

Example: Calculate recommendedWhenOneOf.

Parameters
$template : mixed
$allTemplates : mixed

beforeUsingTemplate()

Before using the template (e.g. expose it to the frontend UI form) we can modify it.

public beforeUsingTemplate(mixed $template) : void

Example: Replace variables with values.

Parameters
$template : mixed

beforeUsingTemplates()

Before using templates (e.g. expose them to the frontend UI form) we can modify them in batch.

public beforeUsingTemplates(mixed &$templates) : void
Parameters
$templates : mixed

getVariableResolver()

Getter.

public getVariableResolver() : mixed
Tags
codeCoverageIgnore

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".

getNormalizedVersions()

Normalize available versions for a template usage context.

private getNormalizedVersions(mixed $template) : array<string|int, int>
Parameters
$template : mixed
Return values
array<string|int, int>

getRequestKey()

Build request cache key for an identifier and versions.

private getRequestKey(string $identifier, array<string|int, int> $versions) : mixed
Parameters
$identifier : string
$versions : array<string|int, int>
On this page

Search results