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
- 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'], 'ADEQUACY' => ['AD', 'AR', 'CA', 'FO', 'GG', 'IL', 'IM', 'JP', 'JE', 'NZ', 'KR', 'CH', 'GB', 'UY', 'US'], ]
- A list of predefined lists for e.g. `GDPR` considered as secury country for data processing in unsafe countries.
Properties
Methods
- 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.
- 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.
- getDataProcessingInUnsafeCountriesSafeCountries() : array<string|int, string>
- Get safe countries for the data-processing-in-unsafe-countries option with expanded predefined lists.
- getDataProcessingInUnsafeCountriesSafeCountriesRaw() : array<string|int, string>
- Get safe countries for the data-processing-in-unsafe-countries option.
- 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
- 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.
- 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
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'],
'ADEQUACY' => ['AD', 'AR', 'CA', 'FO', 'GG', 'IL', 'IM', 'JP', 'JE', 'NZ', 'KR', 'CH', 'GB', 'UY', 'US'],
]
Properties
$settings
See Settings
private
Settings
$settings
Methods
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
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
intgetDataProcessingInUnsafeCountriesSafeCountries()
Get safe countries for the data-processing-in-unsafe-countries option with expanded predefined lists.
public
getDataProcessingInUnsafeCountriesSafeCountries() : array<string|int, string>
Return values
array<string|int, string>getDataProcessingInUnsafeCountriesSafeCountriesRaw()
Get safe countries for the data-processing-in-unsafe-countries option.
public
abstract getDataProcessingInUnsafeCountriesSafeCountriesRaw() : array<string|int, string>
Return values
array<string|int, string>getFailedConsentDocumentationHandling()
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
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
boolsetCookieVersion()
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