Persist
in package
Persist an array of `vendor-list.json` to the database.
Table of Contents
Constants
- DECLARATION_OVERWRITE_FIELDS = ['name', 'description', 'illustrations']
- Fields which should be updated via `ON DUPLICATE KEY UPDATE`.
- STACKS_OVERWRITE_FIELDS = ['name', 'description', 'purposes', 'specialFeatures']
- TABLE_NAME = 'tcf'
- TABLE_NAME_STACKS = 'stacks'
- TABLE_NAME_VENDORS = 'vendors'
- VENDOR_OVERWRITE_FIELDS = ['name', 'purposes', 'legIntPurposes', 'flexiblePurposes', 'specialPurposes', 'features', 'specialFeatures', 'usesCookies', 'cookieMaxAgeSeconds', 'cookieRefresh', 'usesNonCookieAccess', 'deviceStorageDisclosureUrl', 'deviceStorageDisclosureViolation', 'deviceStorageDisclosure', 'additionalInformation', 'dataRetention', 'dataDeclaration', 'urls']
Properties
- $downloader : Downloader
- The downloader.
- $normalizer : TcfVendorListNormalizer
- The normalizer.
Methods
- __construct() : mixed
- C'tor.
- getDownloader() : mixed
- Getter.
- getNormalizer() : mixed
- Getter.
- normalizeDeclarations() : mixed
- Parse `vendor-list.json`, normalize purposes and features and push it up to the database.
- normalizeStacks() : mixed
- Parse `vendor-list.json`, normalize stacks and push it up to the database.
- normalizeVendors() : mixed
- This function does not persist purposes and features!
- persistDeclaration() : mixed
- Persist an array of rows to the database.
- persistStacks() : mixed
- Persist an array of rows to the database.
- persistVendors() : mixed
- Persist an array of rows to the database.
Constants
DECLARATION_OVERWRITE_FIELDS
Fields which should be updated via `ON DUPLICATE KEY UPDATE`.
public
mixed
DECLARATION_OVERWRITE_FIELDS
= ['name', 'description', 'illustrations']
STACKS_OVERWRITE_FIELDS
public
mixed
STACKS_OVERWRITE_FIELDS
= ['name', 'description', 'purposes', 'specialFeatures']
TABLE_NAME
public
mixed
TABLE_NAME
= 'tcf'
TABLE_NAME_STACKS
public
mixed
TABLE_NAME_STACKS
= 'stacks'
TABLE_NAME_VENDORS
public
mixed
TABLE_NAME_VENDORS
= 'vendors'
VENDOR_OVERWRITE_FIELDS
public
mixed
VENDOR_OVERWRITE_FIELDS
= ['name', 'purposes', 'legIntPurposes', 'flexiblePurposes', 'specialPurposes', 'features', 'specialFeatures', 'usesCookies', 'cookieMaxAgeSeconds', 'cookieRefresh', 'usesNonCookieAccess', 'deviceStorageDisclosureUrl', 'deviceStorageDisclosureViolation', 'deviceStorageDisclosure', 'additionalInformation', 'dataRetention', 'dataDeclaration', 'urls']
Properties
$downloader
The downloader.
private
Downloader
$downloader
$normalizer
The normalizer.
private
TcfVendorListNormalizer
$normalizer
Methods
__construct()
C'tor.
public
__construct(TcfVendorListNormalizer $normalizer, Downloader $downloader) : mixed
Parameters
- $normalizer : TcfVendorListNormalizer
- $downloader : Downloader
getDownloader()
Getter.
public
getDownloader() : mixed
Tags
getNormalizer()
Getter.
public
getNormalizer() : mixed
Tags
normalizeDeclarations()
Parse `vendor-list.json`, normalize purposes and features and push it up to the database.
public
normalizeDeclarations(string $language, array<string|int, mixed> $translation) : mixed
This function does not persist vendors!
Parameters
- $language : string
- $translation : array<string|int, mixed>
normalizeStacks()
Parse `vendor-list.json`, normalize stacks and push it up to the database.
public
normalizeStacks(string $language, array<string|int, mixed> $translation) : mixed
Parameters
- $language : string
- $translation : array<string|int, mixed>
normalizeVendors()
This function does not persist purposes and features!
public
normalizeVendors() : mixed
persistDeclaration()
Persist an array of rows to the database.
protected
persistDeclaration(string $declarationType, array<string|int, string> &$rows) : mixed
Parameters
- $declarationType : string
-
See
StackCalculator::DECLARATION_TYPES
- $rows : array<string|int, string>
persistStacks()
Persist an array of rows to the database.
protected
persistStacks(array<string|int, string> &$rows) : mixed
Parameters
- $rows : array<string|int, string>
persistVendors()
Persist an array of rows to the database.
protected
persistVendors(array<string|int, string> $rows) : mixed
Parameters
- $rows : array<string|int, string>