ServiceTemplate
extends AbstractTemplate
in package
Service template.
Table of Contents
Constants
- STATUS_DRAFT = 'draft'
- STATUS_PUBLISHED = 'published'
- TIER_FREE = 'free'
- TIER_PRO = 'pro'
Properties
- $codeOnPageLoad : string
- Code on page load.
- $codeOptIn : string
- Code on opt in.
- $codeOptOut : string
- Code on opt in.
- $consumerData : array<string|int, mixed>
- Calculated consumer data which can be filled by middlewares.
- $createContentBlockerNotice : string
- Create-content-blocker notice.
- $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).
- $dataProcessingInCountries : array<string|int, string>
- In which countries does thie service template process data? 2-letter ISO codes.
- $dataProcessingInCountriesSpecialTreatments : array<string|int, string>
- When a service processes data to an unsafe country, the user can select from various special treatments to skip the consent via GDPR Article 49.
- $deleteTechnicalDefinitionsAfterOptOut : bool
- If `true` the plugin should try to delete all technical definitions on opt-out.
- $dynamicFields : array<string|int, mixed>
- Dynamic fields for the code / script fields.
- $enabledWhenOneOf : array<string|int, string>
- Meta data: rules overwriting the `isDisabled` property.
- $executeCodeOptInWhenNoTagManagerConsentIsGiven : bool
- Execute code on opt-in only when consent for tag manager is not given.
- $executeCodeOptOutWhenNoTagManagerConsentIsGiven : bool
- Execute code on opt-in only when consent for tag manager is not given.
- $extendsIdentifier : string
- Meta data: when this template got extended this is the parent identifier.
- $googleConsentModeConsentTypes : array<string|int, string>
- Google Consent Mode consent types.
- $group : string
- Predefined group.
- $groupNotice : string
- Group notice.
- $headline : string
- Meta data: headline.
- $id : int
- Meta data: external ID within service cloud.
- $identifier : string
- Meta data: Unique identifier within service cloud.
- $isEmbeddingOnlyExternalResources : bool
- If `true` the service does not set any cookies but transfers e.g. ip address through a network request.
- $isHidden : int
- Meta data: only store the template but never show e.g. in frontend.
- $isProviderCurrentWebsite : bool
- If yes there will be no external privacy policy, imprint and provider name. It needs to be filled with a middleware or manually.
- $language : string
- Meta data: Language in 2-char.
- $legalBasis : string
- Legal basis.
- $legalBasisNotice : string
- Legal basis notice.
- $logoUrl : mixed
- Meta data: logo of template.
- $name : string
- Meta data: name
- $provider : string
- Provider name.
- $providerContact : stdClass
- Provider contact (email, phone, link).
- $providerLegalNoticeUrl : string
- Provider legal notice URL (e.g. imprint).
- $providerNotice : string
- Provider notice.
- $providerPrivacyPolicyUrl : string
- Provider privacy policy URL.
- $purpose : string
- Purpose of the service.
- $recommendedWhenOneOf : array<string|int, string>
- Meta data: rules overwriting the `consumerData['isRecommended']` property.
- $shouldUncheckContentBlockerCheckbox : bool
- By default, when a content blocker for a service exists it should be automatically created in UI.
- $shouldUncheckContentBlockerCheckboxWhenOneOf : array<string|int, string>
- Set `shouldUncheckContentBlockerCheckbox` with `WhenOneOf` statements.
- $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.
- $tagManagerOptInEventName : string
- Tag manager opt-in event name.
- $tagManagerOptOutEventName : string
- Tag manager opt-out event name.
- $technicalDefinitions : array<string|int, mixed>
- Technical definitions.
- $technicalHandlingNotice : string
- Technical-handling notice.
- $tier : string
- Meta data: Can be `free` or `pro`.
- $version : int
- Meta data: headline.
- $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
STATUS_DRAFT
public
mixed
STATUS_DRAFT
= 'draft'
STATUS_PUBLISHED
public
mixed
STATUS_PUBLISHED
= 'published'
TIER_FREE
public
mixed
TIER_FREE
= 'free'
TIER_PRO
public
mixed
TIER_PRO
= 'pro'
Properties
$codeOnPageLoad
Code on page load.
public
string
$codeOnPageLoad
$codeOptIn
Code on opt in.
public
string
$codeOptIn
$codeOptOut
Code on opt in.
public
string
$codeOptOut
$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
$createContentBlockerNotice
Create-content-blocker notice.
public
string
$createContentBlockerNotice
$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
$dataProcessingInCountries
In which countries does thie service template process data? 2-letter ISO codes.
public
array<string|int, string>
$dataProcessingInCountries
= []
$dataProcessingInCountriesSpecialTreatments
When a service processes data to an unsafe country, the user can select from various special treatments to skip the consent via GDPR Article 49.
public
array<string|int, string>
$dataProcessingInCountriesSpecialTreatments
= []
$deleteTechnicalDefinitionsAfterOptOut
If `true` the plugin should try to delete all technical definitions on opt-out.
public
bool
$deleteTechnicalDefinitionsAfterOptOut
$dynamicFields
Dynamic fields for the code / script fields.
public
array<string|int, mixed>
$dynamicFields
= []
$enabledWhenOneOf
Meta data: rules overwriting the `isDisabled` property.
public
array<string|int, string>
$enabledWhenOneOf
= []
$executeCodeOptInWhenNoTagManagerConsentIsGiven
Execute code on opt-in only when consent for tag manager is not given.
public
bool
$executeCodeOptInWhenNoTagManagerConsentIsGiven
$executeCodeOptOutWhenNoTagManagerConsentIsGiven
Execute code on opt-in only when consent for tag manager is not given.
public
bool
$executeCodeOptOutWhenNoTagManagerConsentIsGiven
$extendsIdentifier
Meta data: when this template got extended this is the parent identifier.
public
string
$extendsIdentifier
$googleConsentModeConsentTypes
Google Consent Mode consent types.
public
array<string|int, string>
$googleConsentModeConsentTypes
= []
$group
Predefined group.
public
string
$group
$groupNotice
Group notice.
public
string
$groupNotice
$headline
Meta data: headline.
public
string
$headline
$id
Meta data: external ID within service cloud.
public
int
$id
$identifier
Meta data: Unique identifier within service cloud.
public
string
$identifier
$isEmbeddingOnlyExternalResources
If `true` the service does not set any cookies but transfers e.g. ip address through a network request.
public
bool
$isEmbeddingOnlyExternalResources
$isHidden
Meta data: only store the template but never show e.g. in frontend.
public
int
$isHidden
$isProviderCurrentWebsite
If yes there will be no external privacy policy, imprint and provider name. It needs to be filled with a middleware or manually.
public
bool
$isProviderCurrentWebsite
$language
Meta data: Language in 2-char.
public
string
$language
$legalBasis
Legal basis.
public
string
$legalBasis
$legalBasisNotice
Legal basis notice.
public
string
$legalBasisNotice
$logoUrl
Meta data: logo of template.
public
mixed
$logoUrl
$name
Meta data: name
public
string
$name
$provider
Provider name.
public
string
$provider
$providerContact
Provider contact (email, phone, link).
public
stdClass
$providerContact
$providerLegalNoticeUrl
Provider legal notice URL (e.g. imprint).
public
string
$providerLegalNoticeUrl
$providerNotice
Provider notice.
public
string
$providerNotice
$providerPrivacyPolicyUrl
Provider privacy policy URL.
public
string
$providerPrivacyPolicyUrl
$purpose
Purpose of the service.
public
string
$purpose
$recommendedWhenOneOf
Meta data: rules overwriting the `consumerData['isRecommended']` property.
public
array<string|int, string>
$recommendedWhenOneOf
= []
$shouldUncheckContentBlockerCheckbox
By default, when a content blocker for a service exists it should be automatically created in UI.
public
bool
$shouldUncheckContentBlockerCheckbox
Set this to true
if the checkbox in the UI should not be checked and continue without Content Blocker.
$shouldUncheckContentBlockerCheckboxWhenOneOf
Set `shouldUncheckContentBlockerCheckbox` with `WhenOneOf` statements.
public
array<string|int, string>
$shouldUncheckContentBlockerCheckboxWhenOneOf
= []
$status
Meta data: status within the service cloud (`published`, `draft`).
public
string
$status
$subHeadline
Meta data: sub headline.
public
string
$subHeadline
$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
= []
$tagManagerOptInEventName
Tag manager opt-in event name.
public
string
$tagManagerOptInEventName
$tagManagerOptOutEventName
Tag manager opt-out event name.
public
string
$tagManagerOptOutEventName
$technicalDefinitions
Technical definitions.
public
array<string|int, mixed>
$technicalDefinitions
= []
$technicalHandlingNotice
Technical-handling notice.
public
string
$technicalHandlingNotice
$tier
Meta data: Can be `free` or `pro`.
public
string
$tier
$version
Meta data: headline.
public
int
$version
$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.
$consumer
private
mixed
$consumer
Methods
__clone()
public
__clone() : mixed
__construct()
C'tor.
public
__construct(ServiceCloudConsumer $consumer) : mixed
Parameters
- $consumer : ServiceCloudConsumer
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
getConsumer()
Getter.
public
getConsumer() : mixed
Tags
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
toArray()
Output this service template as array. This is statically available to make usage with `array_map` more easier.
public
static toArray(AbstractTemplate $template) : mixed
Parameters
- $template : AbstractTemplate
toArrays()
Output multiple service templates as array representation.
public
static toArrays(array<string|int, AbstractTemplate> $templates) : mixed
Parameters
- $templates : array<string|int, AbstractTemplate>
use()
Modifies the template data through middleware and e.g. replaces content, variables, .
public
use() : static
..