AbstractCountryBypass
extends BaseSettings
in package
Abstract implementation of the settings for country bypass settings.
Table of Contents
Constants
- CUSTOM_BYPASS = 'geolocation'
- PREDEFINED_COUNTRY_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'], 'CCPA' => ['US'], ]
- A list of predefined lists for e.g. `GDPR` or `CCPA`.
- TYPE_ALL = 'all'
- TYPE_ESSENTIALS = 'essentials'
Properties
Methods
- getCountries() : array<string|int, string>
- Get the list of countries where the banner should be shown, expanded with predefined lists (ISO 3166-1 alpha2).
- getCountriesRaw() : array<string|int, string>
- Get the list of countries where the banner should be shown.
- getNextUpdateTime() : mixed
- Changes to the country database are published daily, but we do this only once a week.
- getSettings() : mixed
- Getter.
- getType() : string
- Get the type for the Country Bypass. Can be `all` or `essentials` (see class constants).
- isActive() : bool
- Check if compatibility is enabled.
- lookupCountryCode() : string
- Get the country for the passed IP address.
- probablyCreateTransaction() : mixed
- If Country Bypass is active and the requested IP address does match our settings, we can prepare a `Tansaction` instance which we can instantly use to `Consent#commit` so the user does not see any cookie banner (see also the term "Predecision Gateway").
- setSettings() : mixed
- Setter.
Constants
CUSTOM_BYPASS
public
mixed
CUSTOM_BYPASS
= 'geolocation'
PREDEFINED_COUNTRY_LISTS
A list of predefined lists for e.g. `GDPR` or `CCPA`.
public
mixed
PREDEFINED_COUNTRY_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'],
'CCPA' => ['US'],
]
TYPE_ALL
public
mixed
TYPE_ALL
= 'all'
TYPE_ESSENTIALS
public
mixed
TYPE_ESSENTIALS
= 'essentials'
Properties
$settings
See Settings
private
Settings
$settings
Methods
getCountries()
Get the list of countries where the banner should be shown, expanded with predefined lists (ISO 3166-1 alpha2).
public
getCountries() : array<string|int, string>
Return values
array<string|int, string>getCountriesRaw()
Get the list of countries where the banner should be shown.
public
abstract getCountriesRaw() : array<string|int, string>
Return values
array<string|int, string>getNextUpdateTime()
Changes to the country database are published daily, but we do this only once a week.
public
static getNextUpdateTime() : mixed
getSettings()
Getter.
public
getSettings() : mixed
Tags
getType()
Get the type for the Country Bypass. Can be `all` or `essentials` (see class constants).
public
abstract getType() : string
Return values
stringisActive()
Check if compatibility is enabled.
public
abstract isActive() : bool
Return values
boollookupCountryCode()
Get the country for the passed IP address.
public
abstract lookupCountryCode(string $ipAddress) : string
Parameters
- $ipAddress : string
Return values
stringprobablyCreateTransaction()
If Country Bypass is active and the requested IP address does match our settings, we can prepare a `Tansaction` instance which we can instantly use to `Consent#commit` so the user does not see any cookie banner (see also the term "Predecision Gateway").
public
probablyCreateTransaction(Consent $consent, Transaction $transaction) : mixed
Parameters
- $consent : Consent
-
The current consent
- $transaction : Transaction
-
A prepared transaction which has
userAgent
,ipAddress
filled
setSettings()
Setter.
public
setSettings(Settings $settings) : mixed
Parameters
- $settings : Settings