TcfVendorListNormalizer
in package
Factory to prepare installation of database tables, provide a downloader and normalize automatically to database.
Table of Contents
Properties
- $compLanguage : AbstractLanguagePlugin
- See AbstractLanguagePlugin;
- $dbPrefix : mixed
- $endpoint : mixed
- $fetchQueryArgs : mixed
- $query : Query
- Query instance.
Methods
- __construct() : mixed
- C'tor.
- clear() : mixed
- Clear all the database tables.
- dbDelta() : mixed
- Make sure the database tables are created.
- getCompLanguage() : mixed
- Getter.
- getEndpoint() : mixed
- Getter.
- getFetchQueryArgs() : mixed
- Getter.
- getQuery() : mixed
- Getter.
- getTableName() : mixed
- Getter.
- setFetchQueryArgs() : mixed
- Setter.
- uncamelize() : mixed
- Uncamlize a given string. Useful to map purpose types to table names e.g. `specialPurposes` -> `special_purposes`.
- update() : WP_Error|true
- Update the vendor list in database (fetch vendor list + translations and persist).
- init() : mixed
- Initialize the factory with further classes.
- updateLanguage() : mixed
- Update a specific language (skips default TCF language). Do not use this, use `update` instead.
Properties
$compLanguage
See AbstractLanguagePlugin;
private
AbstractLanguagePlugin
$compLanguage
$dbPrefix
private
mixed
$dbPrefix
$endpoint
private
mixed
$endpoint
$fetchQueryArgs
private
mixed
$fetchQueryArgs
$query
Query instance.
private
Query
$query
Methods
__construct()
C'tor.
public
__construct(string $dbPrefix, string $endpoint[, AbstractLanguagePlugin $compLanguage = null ][, array<string|int, mixed> $fetchQueryArgs = [] ]) : mixed
Parameters
- $dbPrefix : string
-
Prefix for the database table to keep isolated per-plugin
- $endpoint : string
-
The endpoint where
vendor-list.json
andpurposes-de.json
can be appended - $compLanguage : AbstractLanguagePlugin = null
- $fetchQueryArgs : array<string|int, mixed> = []
-
Additional query parameters, e.g. license key
clear()
Clear all the database tables.
public
clear() : mixed
dbDelta()
Make sure the database tables are created.
public
dbDelta(Activator $activator) : mixed
Parameters
- $activator : Activator
getCompLanguage()
Getter.
public
getCompLanguage() : mixed
Tags
getEndpoint()
Getter.
public
getEndpoint() : mixed
Tags
getFetchQueryArgs()
Getter.
public
getFetchQueryArgs() : mixed
Tags
getQuery()
Getter.
public
getQuery() : mixed
Tags
getTableName()
Getter.
public
getTableName([string $name = null ]) : mixed
Parameters
- $name : string = null
setFetchQueryArgs()
Setter.
public
setFetchQueryArgs(array<string|int, mixed> $fetchQueryArgs) : mixed
Parameters
- $fetchQueryArgs : array<string|int, mixed>
Tags
uncamelize()
Uncamlize a given string. Useful to map purpose types to table names e.g. `specialPurposes` -> `special_purposes`.
public
static uncamelize(string $camel[, string $splitter = '_' ]) : mixed
Parameters
- $camel : string
- $splitter : string = '_'
Tags
update()
Update the vendor list in database (fetch vendor list + translations and persist).
public
update() : WP_Error|true
Return values
WP_Error|trueinit()
Initialize the factory with further classes.
protected
init() : mixed
updateLanguage()
Update a specific language (skips default TCF language). Do not use this, use `update` instead.
protected
updateLanguage(string $locale, Persist $persist) : mixed
Parameters
- $locale : string
- $persist : Persist