AbstractConsent
extends BaseSettings
in package
Abstract implementation of the settings for misc consent settings (e.g. duration of consent management cookie which saves the decision of the user).
Table of Contents
Constants
- AGE_NOTICE_COUNTRY_AGE_MAP = ['INHERIT' => 0, 'GDPR' => 16, 'BE' => 13, 'DK' => 13, 'EE' => 13, 'FI' => 13, 'IS' => 13, 'LV' => 13, 'NO' => 13, 'PT' => 13, 'SE' => 13, 'MT' => 13, 'AT' => 14, 'BG' => 14, 'CY' => 14, 'IT' => 14, 'LT' => 14, 'ES' => 14, 'CZ' => 15, 'FR' => 15, 'GR' => 15, 'SI' => 15, 'DE' => 16, 'HR' => 16, 'HU' => 16, 'LI' => 16, 'LU' => 16, 'NL' => 16, 'PL' => 16, 'RO' => 16, 'SK' => 16, 'IE' => 16, 'CH' => 13]
- COOKIE_VERSION_1 = 1
- Search the coding for difference.
- COOKIE_VERSION_2 = 2
- COOKIE_VERSION_3 = 3
- CUSTOM_BYPASS_BANNER_LESS_CONSENT = 'bannerless'
- DEFAULT_COOKIE_VERSION = self::COOKIE_VERSION_3
- FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY = 'essentials'
- FAILED_CONSENT_DOCUMENTATION_HANDLING_OPTIMISTIC = 'optimistic'
- FAILED_CONSENT_DOCUMENTATION_HANDLINGS = [self::FAILED_CONSENT_DOCUMENTATION_HANDLING_OPTIMISTIC, self::FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY]
- PREDEFINED_DATA_PROCESSING_IN_SAFE_COUNTRIES_LISTS = [ // EU: https://reciprocitylabs.com/resources/what-countries-are-covered-by-gdpr/ // EEA: https://ec.europa.eu/eurostat/statistics-explained/index.php?title=Glossary:European_Economic_Area_(EEA) 'GDPR' => ['AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LV', 'LT', 'LU', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE'], 'DSG' => ['CH'], 'GDPR+DSG' => [], 'ADEQUACY_EU' => ['AD', 'AR', 'CA', 'FO', 'GG', 'IL', 'IM', 'JP', 'JE', 'NZ', 'KR', 'CH', 'GB', 'UY', 'US'], 'ADEQUACY_CH' => ['DE', 'AD', 'AR', 'AT', 'BE', 'BG', 'CA', 'CY', 'HR', 'DK', 'ES', 'EE', 'FI', 'FR', 'GI', 'GR', 'GG', 'HU', 'IM', 'FO', 'IE', 'IS', 'IL', 'IT', 'JE', 'LV', 'LI', 'LT', 'LU', 'MT', 'MC', 'NO', 'NZ', 'NL', 'PL', 'PT', 'CZ', 'RO', 'GB', 'SK', 'SI', 'SE', 'UY', 'US'], ]
- A list of predefined lists for e.g. `GDPR` considered as secury country for data processing in unsafe countries.
Properties
Methods
- calculateBannerlessConsentChecks() : array<string|int, mixed>
- Calculate if the bannerless consent check should be enabled.
- calculateServicesWithDataProcessingInUnsafeCountries() : mixed
- Calculate configured services which are processing data in unsafe countries.
- getAgeNoticeAgeLimit() : int
- Get the configured age limit for the age notice.
- getAgeNoticeAgeLimitRaw() : string|int
- Get the configured age limit for the age notice in raw format.
- getBannerLessConsentShowOnPageIds() : array<string|int, int>
- Get the page IDs where the banner less consent should be shown.
- getConsentDuration() : int
- Get the consent duration in months.
- getCookieDuration() : int
- Get the cookie duration for the consent cookies in days.
- getCookieVersion() : int
- Get the cookie version for the consent cookies.
- getFailedConsentDocumentationHandling() : string
- Get the behavior what should be done when documentating the consent fails. See als `FAILED_CONSENT_HANDLINGS`.
- getSettings() : mixed
- Getter.
- isAcceptAllForBots() : bool
- Check if bots should acceppt all cookies automatically.
- isAgeNoticeEnabled() : bool
- Check if age notice hint is enabled
- isBannerLessConsent() : bool
- Check if banner less consent is enabled.
- isDataProcessingInUnsafeCountries() : bool
- Check if data processing in unsafe countries is enabled.
- isListServicesNoticeEnabled() : bool
- Check if list-services notice hint is enabled
- isRespectDoNotTrack() : bool
- Check if "Do not Track" header is respected.
- isSaveIpEnabled() : bool
- Check if IPs should be saved in plain in database.
- probablyCreateBannerlessConsentTransaction() : mixed
- If bannerless consent is enabled, we can create a transaction which we can instantly use to `Consent#commit` so the user does not see any cookie banner.
- setCookieVersion() : mixed
- Set the cookie version for the consent cookies.
- setSettings() : mixed
- Setter.
Constants
AGE_NOTICE_COUNTRY_AGE_MAP
public
mixed
AGE_NOTICE_COUNTRY_AGE_MAP
= ['INHERIT' => 0, 'GDPR' => 16, 'BE' => 13, 'DK' => 13, 'EE' => 13, 'FI' => 13, 'IS' => 13, 'LV' => 13, 'NO' => 13, 'PT' => 13, 'SE' => 13, 'MT' => 13, 'AT' => 14, 'BG' => 14, 'CY' => 14, 'IT' => 14, 'LT' => 14, 'ES' => 14, 'CZ' => 15, 'FR' => 15, 'GR' => 15, 'SI' => 15, 'DE' => 16, 'HR' => 16, 'HU' => 16, 'LI' => 16, 'LU' => 16, 'NL' => 16, 'PL' => 16, 'RO' => 16, 'SK' => 16, 'IE' => 16, 'CH' => 13]
COOKIE_VERSION_1
Search the coding for difference.
public
mixed
COOKIE_VERSION_1
= 1
COOKIE_VERSION_2
public
mixed
COOKIE_VERSION_2
= 2
COOKIE_VERSION_3
public
mixed
COOKIE_VERSION_3
= 3
CUSTOM_BYPASS_BANNER_LESS_CONSENT
public
mixed
CUSTOM_BYPASS_BANNER_LESS_CONSENT
= 'bannerless'
DEFAULT_COOKIE_VERSION
public
mixed
DEFAULT_COOKIE_VERSION
= self::COOKIE_VERSION_3
FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY
public
mixed
FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY
= 'essentials'
FAILED_CONSENT_DOCUMENTATION_HANDLING_OPTIMISTIC
public
mixed
FAILED_CONSENT_DOCUMENTATION_HANDLING_OPTIMISTIC
= 'optimistic'
FAILED_CONSENT_DOCUMENTATION_HANDLINGS
public
mixed
FAILED_CONSENT_DOCUMENTATION_HANDLINGS
= [self::FAILED_CONSENT_DOCUMENTATION_HANDLING_OPTIMISTIC, self::FAILED_CONSENT_DOCUMENTATION_HANDLING_ESSENTIALS_ONLY]
PREDEFINED_DATA_PROCESSING_IN_SAFE_COUNTRIES_LISTS
A list of predefined lists for e.g. `GDPR` considered as secury country for data processing in unsafe countries.
public
mixed
PREDEFINED_DATA_PROCESSING_IN_SAFE_COUNTRIES_LISTS
= [
// EU: https://reciprocitylabs.com/resources/what-countries-are-covered-by-gdpr/
// EEA: https://ec.europa.eu/eurostat/statistics-explained/index.php?title=Glossary:European_Economic_Area_(EEA)
'GDPR' => ['AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IS', 'IT', 'LI', 'LV', 'LT', 'LU', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE'],
'DSG' => ['CH'],
'GDPR+DSG' => [],
'ADEQUACY_EU' => ['AD', 'AR', 'CA', 'FO', 'GG', 'IL', 'IM', 'JP', 'JE', 'NZ', 'KR', 'CH', 'GB', 'UY', 'US'],
'ADEQUACY_CH' => ['DE', 'AD', 'AR', 'AT', 'BE', 'BG', 'CA', 'CY', 'HR', 'DK', 'ES', 'EE', 'FI', 'FR', 'GI', 'GR', 'GG', 'HU', 'IM', 'FO', 'IE', 'IS', 'IL', 'IT', 'JE', 'LV', 'LI', 'LT', 'LU', 'MT', 'MC', 'NO', 'NZ', 'NL', 'PL', 'PT', 'CZ', 'RO', 'GB', 'SK', 'SI', 'SE', 'UY', 'US'],
]
Properties
$settings
See Settings
private
Settings
$settings
Methods
calculateBannerlessConsentChecks()
Calculate if the bannerless consent check should be enabled.
public
calculateBannerlessConsentChecks() : array<string|int, mixed>
Return values
array<string|int, mixed>calculateServicesWithDataProcessingInUnsafeCountries()
Calculate configured services which are processing data in unsafe countries.
public
calculateServicesWithDataProcessingInUnsafeCountries() : mixed
getAgeNoticeAgeLimit()
Get the configured age limit for the age notice.
public
getAgeNoticeAgeLimit() : int
Return values
intgetAgeNoticeAgeLimitRaw()
Get the configured age limit for the age notice in raw format.
public
abstract getAgeNoticeAgeLimitRaw() : string|int
Return values
string|int —Can be an integer or "INHERIT"
string
getBannerLessConsentShowOnPageIds()
Get the page IDs where the banner less consent should be shown.
public
abstract getBannerLessConsentShowOnPageIds() : array<string|int, int>
Return values
array<string|int, int>getConsentDuration()
Get the consent duration in months.
public
abstract getConsentDuration() : int
Return values
intgetCookieDuration()
Get the cookie duration for the consent cookies in days.
public
abstract getCookieDuration() : int
Return values
intgetCookieVersion()
Get the cookie version for the consent cookies.
public
abstract getCookieVersion() : int
Return values
intgetFailedConsentDocumentationHandling()
Get the behavior what should be done when documentating the consent fails. See als `FAILED_CONSENT_HANDLINGS`.
public
abstract getFailedConsentDocumentationHandling() : string
Return values
stringgetSettings()
Getter.
public
getSettings() : mixed
Tags
isAcceptAllForBots()
Check if bots should acceppt all cookies automatically.
public
abstract isAcceptAllForBots() : bool
Return values
boolisAgeNoticeEnabled()
Check if age notice hint is enabled
public
abstract isAgeNoticeEnabled() : bool
Return values
boolisBannerLessConsent()
Check if banner less consent is enabled.
public
abstract isBannerLessConsent() : bool
Return values
boolisDataProcessingInUnsafeCountries()
Check if data processing in unsafe countries is enabled.
public
abstract isDataProcessingInUnsafeCountries() : bool
Return values
boolisListServicesNoticeEnabled()
Check if list-services notice hint is enabled
public
abstract isListServicesNoticeEnabled() : bool
Return values
boolisRespectDoNotTrack()
Check if "Do not Track" header is respected.
public
abstract isRespectDoNotTrack() : bool
Return values
boolisSaveIpEnabled()
Check if IPs should be saved in plain in database.
public
abstract isSaveIpEnabled() : bool
Return values
boolprobablyCreateBannerlessConsentTransaction()
If bannerless consent is enabled, we can create a transaction which we can instantly use to `Consent#commit` so the user does not see any cookie banner.
public
probablyCreateBannerlessConsentTransaction(Consent $consent, Transaction $transaction, int $currentPageId, string $defaultTcfString) : mixed
Parameters
- $consent : Consent
-
The current consent
- $transaction : Transaction
-
A prepared transaction which has
userAgent
,ipAddress
filled - $currentPageId : int
-
The current page ID which is used to get the page ID from the
bannerLessConsentShowOnPageIds
array - $defaultTcfString : string
-
The default TCF string which is used if no TCF string is provided
setCookieVersion()
Set the cookie version for the consent cookies.
public
abstract setCookieVersion(int $version) : mixed
Parameters
- $version : int
setSettings()
Setter.
public
setSettings(Settings $settings) : mixed
Parameters
- $settings : Settings