Revision
in package
A revision is a document of all settings at the time of consent.
What does "independent" in context to "Revision" mean? There are two types of revisions, the independent one holds all settings and data which would not lead to a new required consent on the frontend for the cookie banner. On the other side, when a non-independent setting and data changes, this needs a new consent from the website visitor on the frontend.
Table of Contents
Constants
- TYPE_ALL = 'all'
- TYPE_INDEPENDENT = 'independent'
- TYPE_REQUIRE_NEW_CONSENT = 'dependent'
Properties
- $cookieConsentManagement : CookieConsentManagement
- See `CookieConsentManagement`.
- $persistence : AbstractRevisionPersistance
- See `AbstractRevisionPersistance`.
Methods
- __construct() : mixed
- C'tor.
- bannerLinkToJson() : array<string|int, array<string|int, mixed>>
- All banner links as JSON representation.
- blockersToJson() : array<string|int, array<string|int, mixed>>
- All content blockers as JSON representation.
- create() : array<string|int, mixed>
- Create a MD5 hash from all available options and settings, save also as "current revision" if necessery.
- createIndependent() : array<string|int, mixed>
- Create a MD5 hash from all available options and settings which do not require a new consent (independent).
- getCookieConsentManagement() : mixed
- Getter.
- getEnsuredCurrentHash() : string
- Get the current active revision. If there is not current revision (only after activating the plugin itself), the current revision hash gets calculated from current settings.
- getPersistence() : mixed
- Getter.
- nonVisualBlockersToJson() : array<string|int, array<string|int, mixed>>
- All non-visual content blockers as they should require a new consent.
- optionsToJson() : mixed
- Get settings as array object so it can be used within e.g. JSON or serialize to the frontend.
- prepareJsonForFrontend() : mixed
- Prepare a revision JSON for frontend.
- serviceGroupsToJson() : array<string|int, array<string|int, mixed>>
- All service groups as JSON representation.
- tcfMetadataToJson() : mixed
- TCF metadata to array.
- tcfToJson() : mixed
- TCF data (vendors, declarations, stacks, ...) to array.
- websiteOperatorToJson() : mixed
- Operator as own object as it is needed in this format for `@devowl-wp/react-cookie-banner`.
Constants
TYPE_ALL
public
mixed
TYPE_ALL
= 'all'
TYPE_INDEPENDENT
public
mixed
TYPE_INDEPENDENT
= 'independent'
TYPE_REQUIRE_NEW_CONSENT
public
mixed
TYPE_REQUIRE_NEW_CONSENT
= 'dependent'
Properties
$cookieConsentManagement
See `CookieConsentManagement`.
private
CookieConsentManagement
$cookieConsentManagement
$persistence
See `AbstractRevisionPersistance`.
private
AbstractRevisionPersistance
$persistence
Methods
__construct()
C'tor.
public
__construct(CookieConsentManagement $cookieConsentManagement, AbstractRevisionPersistance $persistence) : mixed
Parameters
- $cookieConsentManagement : CookieConsentManagement
- $persistence : AbstractRevisionPersistance
bannerLinkToJson()
All banner links as JSON representation.
public
bannerLinkToJson() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>blockersToJson()
All content blockers as JSON representation.
public
blockersToJson() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>create()
Create a MD5 hash from all available options and settings, save also as "current revision" if necessery.
public
create([bool|string $persist = false ][, bool $forceNewConsent = true ]) : array<string|int, mixed>
If the hash differs, a new consent is needed!
Parameters
- $persist : bool|string = false
-
Persist the revision in database, pass
force
to force-write into the database - $forceNewConsent : bool = true
Return values
array<string|int, mixed> —'revision' and 'hash'
createIndependent()
Create a MD5 hash from all available options and settings which do not require a new consent (independent).
public
createIndependent([bool $persist = false ]) : array<string|int, mixed>
Parameters
- $persist : bool = false
-
Persist the revision in database
Return values
array<string|int, mixed> —'revision' and 'hash'
getCookieConsentManagement()
Getter.
public
getCookieConsentManagement() : mixed
Tags
getEnsuredCurrentHash()
Get the current active revision. If there is not current revision (only after activating the plugin itself), the current revision hash gets calculated from current settings.
public
getEnsuredCurrentHash() : string
Return values
stringgetPersistence()
Getter.
public
getPersistence() : mixed
Tags
nonVisualBlockersToJson()
All non-visual content blockers as they should require a new consent.
public
nonVisualBlockersToJson() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>optionsToJson()
Get settings as array object so it can be used within e.g. JSON or serialize to the frontend.
public
optionsToJson([string $type = self::TYPE_ALL ]) : mixed
Parameters
- $type : string = self::TYPE_ALL
-
See
TYPE_
constants
prepareJsonForFrontend()
Prepare a revision JSON for frontend.
public
prepareJsonForFrontend(array<string|int, mixed> $revision) : mixed
Parameters
- $revision : array<string|int, mixed>
serviceGroupsToJson()
All service groups as JSON representation.
public
serviceGroupsToJson() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>tcfMetadataToJson()
TCF metadata to array.
public
tcfMetadataToJson() : mixed
tcfToJson()
TCF data (vendors, declarations, stacks, ...) to array.
public
tcfToJson() : mixed
websiteOperatorToJson()
Operator as own object as it is needed in this format for `@devowl-wp/react-cookie-banner`.
public
websiteOperatorToJson() : mixed