Constants

Properties

$cacheCurrentUser

$cacheCurrentUser :

Type

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

Returns

string

persist()

persist(array|string  $consent,boolean  $markAsDoNotTrack,string  $buttonClicked,integer  $viewPortWidth,integer  $viewPortHeight,string  $referer,integer  $blocker,integer|string  $blockerThumbnail = null,integer  $forwarded,string  $forwardedUuid = null,boolean  $forwardedBlocker = false,string  $tcfString = null,string  $customBypass = null): array

Persist an user consent to the database.

Parameters

array|string $consent

A set of accepted cookie groups + cookies or a predefined set like all or essentials (see UserConsent::validateConsent)

boolean $markAsDoNotTrack
string $buttonClicked
integer $viewPortWidth
integer $viewPortHeight
string $referer
integer $blocker

If the consent came from a content blocker, mark this in our database

integer|string $blockerThumbnail

Can be the ID of the blocker thumbnail itself, or in format of {embedId}-{fileMd5}

integer $forwarded

The reference to the consent ID of the source website (only for forwarded consents)

string $forwardedUuid

The UUID reference of the source website

boolean $forwardedBlocker

Determine if forwarded consent came through a content blocker

string $tcfString

TCF compatibility; encoded TCF string (not the vendor string; isForVendors = false)

string $customBypass

Allows to set a custom bypass which causes the banner to be hidden (e.g. Geolocation)

Returns

array —

The current used user

setCookie()

setCookie(array<mixed,string>  $uuids = null,string  $revision = null,array  $consent = null)

Set or update the existing cookie to the latest revision. It also respect the fact, that cross-site cookies needs to be set with `SameSite=None` attribute.

Parameters

array<mixed,string> $uuids
string $revision
array $consent

getCurrentUser()

getCurrentUser(boolean  $force = false): false|array

Get's the current user from the cookie. The result will hold the unique user id and the accepted revision hash. This function is also ported to JS via `getUserDecision.tsx`.

Parameters

boolean $force

Returns

false|array —

'uuid', previous_uuids, 'created', 'cookie_revision', 'consent_revision', 'decision', 'decision_in_cookie', 'decision_hash'

getCurrentHistory()

getCurrentHistory()

Get the history of the current user.

getCookieName()

getCookieName()

Get cookie name for the current page.

getInstance()

getInstance()

Get singleton instance.

parseCookieValue()

parseCookieValue(string  $value): array

Parse a consent from a given cookie value. The result will hold the unique user id and the accepted revision hash.

Parameters

string $value

Returns

array —

'uuid', previous_uuids, 'created', 'cookie_revision', 'consent_revision', 'decision', 'decision_in_cookie', 'decision_hash'

__construct()

__construct()

C'tor.