Documentation

BlockerTemplate extends AbstractTemplate
in package

Blocker template.

Table of Contents

Constants

STATUS_DRAFT  = 'draft'
STATUS_PUBLISHED  = 'published'
TIER_FREE  = 'free'
TIER_PRO  = 'pro'

Properties

$consumerData  : array<string|int, mixed>
Calculated consumer data which can be filled by middlewares.
$createdAt  : int
Meta data: creation date and time of template version (service cloud saves templates immutable so each new version gets an own updated `createdAt` -> no `modifiedAt` needed).
$description  : string
Additional description for the content blocker.
$enabledWhenOneOf  : array<string|int, string>
Meta data: rules overwriting the `isDisabled` property.
$extendsIdentifier  : string
Meta data: when this template got extended this is the parent identifier.
$headline  : string
Meta data: headline.
$id  : int
Meta data: external ID within service cloud.
$identifier  : string
Meta data: Unique identifier within service cloud.
$isHidden  : int
Meta data: only store the template but never show e.g. in frontend.
$isVisual  : bool
Is visual?
$isVisualDarkMode  : bool
Should the visual be rendered in dark mode?
$language  : string
Meta data: Language in 2-char.
$logoUrl  : mixed
Meta data: logo of template.
$name  : string
Meta data: name
$recommendedWhenOneOf  : array<string|int, string>
Meta data: rules overwriting the `consumerData['isRecommended']` property.
$ruleGroups  : array<string|int, mixed>
Rule groups definitions.
$ruleNotice  : string
Rule notice.
$rules  : array<string|int, mixed>
Rule definitions.
$serviceTemplateIdentifiers  : array<string|int, string>
Connected services as identifier.
$shouldForceToShowVisual  : bool
Should the visual be forced to render also for e.g. script tags?
$status  : string
Meta data: status within the service cloud (`published`, `draft`).
$subHeadline  : string
Meta data: sub headline.
$successorOfIdentifierInfo  : array<string|int, array<string|int, mixed>>
A list of identifiers that replaces this template, as the old template has been deleted.
$tcfVendorIds  : array<string|int, int>
Connected TCF vendor IDs.
$tier  : string
Meta data: Can be `free` or `pro`.
$version  : int
Meta data: headline.
$visualBlur  : number
Blurry the visual content blocker background image.
$visualContentType  : string
Visual content type (audio-player, video-player, ...).
$visualHeroButtonText  : string
Visual hero button text.
$visualType  : string
Visual type (default, wrapped, hero).
$beforeMiddleware  : array<string|int, mixed>
Original, before running any middleware, template data. This is useful for external data sources which should really be contaced e.g. once a day and a invalidation should only "retrigger" recalculation of middlewares.
$consumer  : mixed

Methods

__clone()  : mixed
__construct()  : mixed
C'tor.
fromArray()  : mixed
Override all properties from an array.
getBeforeMiddleware()  : mixed
Getter.
getConsumer()  : mixed
Getter.
memoizeBeforeMiddleware()  : mixed
Memoize current state of template so it can be retrieved with `getBeforeMiddleware` after running all middlewares.
retrieved()  : mixed
Run all `beforeRetrievingTemplate` middlewares.
toArray()  : mixed
Output this service template as array. This is statically available to make usage with `array_map` more easier.
toArrays()  : mixed
Output multiple service templates as array representation.
use()  : static
Modifies the template data through middleware and e.g. replaces content, variables, .

Constants

Properties

$consumerData

Calculated consumer data which can be filled by middlewares.

public array<string|int, mixed> $consumerData = ['tags' => []]

Predefined data:

tags                     = string[]
-- List of tags (like badges), key = Badge text, value = Tooltip text

isCreated                = boolean
-- Is the template created in the consumer environment?

id                       = int
-- ID of the record within the consumer environment using this template

rules                    = string[]
-- Flattened string array of all rule-expressions

isDisabled               = boolean
-- Is this template enabled within this consumer environment (e.g. WordPress plugin active?).

isRecommended            = boolean
-- Is this template recommended within this consumer environment (e.g. Cloudflare detected).

scan                     = { foundCount: number; foundOnSitesCount: number; lastScanned?: string; }
-- Scan results for a given template by identifier.

isIgnored                = boolean
-- Is this template ignored within this consumer environment (e.g. ignored in scanner results).

successorOf              = Array<{ identifier: string; id: int; }>
-- If a template is a successor to another template, this array holds infos about the ID of the record within the consumer environment using this template

$createdAt

Meta data: creation date and time of template version (service cloud saves templates immutable so each new version gets an own updated `createdAt` -> no `modifiedAt` needed).

public int $createdAt

$description

Additional description for the content blocker.

public string $description

$enabledWhenOneOf

Meta data: rules overwriting the `isDisabled` property.

public array<string|int, string> $enabledWhenOneOf = []

$extendsIdentifier

Meta data: when this template got extended this is the parent identifier.

public string $extendsIdentifier

$identifier

Meta data: Unique identifier within service cloud.

public string $identifier

$isHidden

Meta data: only store the template but never show e.g. in frontend.

public int $isHidden

$isVisualDarkMode

Should the visual be rendered in dark mode?

public bool $isVisualDarkMode

$recommendedWhenOneOf

Meta data: rules overwriting the `consumerData['isRecommended']` property.

public array<string|int, string> $recommendedWhenOneOf = []

$ruleGroups

Rule groups definitions.

public array<string|int, mixed> $ruleGroups = []

See api-packages/api-real-cookie-banner/src/entity/template/content-blocker/content-blocker.ts.

$rules

Rule definitions.

public array<string|int, mixed> $rules = []

See api-packages/api-real-cookie-banner/src/entity/template/content-blocker/content-blocker.ts.

$serviceTemplateIdentifiers

Connected services as identifier.

public array<string|int, string> $serviceTemplateIdentifiers = []

$shouldForceToShowVisual

Should the visual be forced to render also for e.g. script tags?

public bool $shouldForceToShowVisual

$status

Meta data: status within the service cloud (`published`, `draft`).

public string $status

$successorOfIdentifierInfo

A list of identifiers that replaces this template, as the old template has been deleted.

public array<string|int, array<string|int, mixed>> $successorOfIdentifierInfo = []

$tcfVendorIds

Connected TCF vendor IDs.

public array<string|int, int> $tcfVendorIds = []

$visualBlur

Blurry the visual content blocker background image.

public number $visualBlur

$visualContentType

Visual content type (audio-player, video-player, ...).

public string $visualContentType

See api-packages/api-real-cookie-banner/src/entity/template/content-blocker/content-blocker.ts.

$visualHeroButtonText

Visual hero button text.

public string $visualHeroButtonText

$visualType

Visual type (default, wrapped, hero).

public string $visualType

See api-packages/api-real-cookie-banner/src/entity/template/content-blocker/content-blocker.ts.

$beforeMiddleware

Original, before running any middleware, template data. This is useful for external data sources which should really be contaced e.g. once a day and a invalidation should only "retrigger" recalculation of middlewares.

private array<string|int, mixed> $beforeMiddleware = null

This data can be for example be saved in a Redis object cache or database column.

Methods

fromArray()

Override all properties from an array.

public fromArray(array<string|int, mixed> $arr) : mixed
Parameters
$arr : array<string|int, mixed>

getBeforeMiddleware()

Getter.

public getBeforeMiddleware() : mixed
Tags
codeCoverageIgnore

getConsumer()

Getter.

public getConsumer() : mixed
Tags
codeCoverageIgnore

memoizeBeforeMiddleware()

Memoize current state of template so it can be retrieved with `getBeforeMiddleware` after running all middlewares.

public memoizeBeforeMiddleware() : mixed

retrieved()

Run all `beforeRetrievingTemplate` middlewares.

public retrieved() : mixed

use()

Modifies the template data through middleware and e.g. replaces content, variables, .

public use() : static

..

Return values
static

        
On this page

Search results