\DevOwl\RealCookieBanner\presetsPresets

Persistence for cookie and blocker presets metadata by using a class list.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
__construct()
getClassList()
fromClassList()
getOtherMetaKeys()
expandResult()
getAllFromCache()
getFromCache()
castReadRow()
getWithAttributes()
needsRecalculation()
forceRegeneration()
persist()
getExpireOption()
getType()
getContextKey()
No public properties found
TABLE_NAME
TRANSIENT_CACHE_KEY
TRANSIENT_CACHE_EXPIRE
No protected methods found
No protected properties found
N/A
No private methods found
$expireOption
$type
N/A

Constants

TABLE_NAME

TABLE_NAME ='presets'

TRANSIENT_CACHE_KEY

TRANSIENT_CACHE_KEY =RCB_OPT_PREFIX . '-%s-presets-%s'

TRANSIENT_CACHE_EXPIRE

TRANSIENT_CACHE_EXPIRE =12 * 60 * 60

Properties

$expireOption

$expireOption :\MatthiasWeb\Utils\ExpireOption

Cache of presets as they can be time-consuming to generate.

So, they are recalculated each x hours.

Type

\MatthiasWeb\Utils\ExpireOption

$type

$type :

Type

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

Returns

string

__construct()

__construct(string  $type)

C'tor.

Parameters

string $type

getClassList()

getClassList(boolean  $force = false)

Get all available presets and persist the metadata to cache.

Parameters

boolean $force

If true, the cache gets invalidated

fromClassList()

fromClassList(array<mixed,string>  $clazzes)

Create presets from `AbstractBlockerPreset` classes.

Parameters

array<mixed,string> $clazzes

getOtherMetaKeys()

getOtherMetaKeys()

Get a list of other meta keys which should be persist to metadata cache.

expandResult()

expandResult(array  $rows)

Expand the read rows with additional, recalculated tags (not cached!).

Parameters

array $rows

getAllFromCache()

getAllFromCache(boolean  $force = false)

Get presets from the cache.

Parameters

boolean $force

If true, the cache gets invalidated

getFromCache()

getFromCache(string  $identifier)

Get a preset from the cache. Returns `false` if preset not in cache.

Parameters

string $identifier

castReadRow()

castReadRow(array  $row)

Cast SQL types.

Parameters

array $row

getWithAttributes()

getWithAttributes(string  $identifier)

Get a preset with attributes resolved. Returns `false` if preset not found or no attributes are available. This function does currently not use the metadata cache!

Parameters

string $identifier

needsRecalculation()

needsRecalculation()

Check if the current preset type needs to be recalculated.

forceRegeneration()

forceRegeneration()

Force regeneration of presets.

persist()

persist(array  $items)

Persist a set of presets.

Parameters

array $items

getExpireOption()

getExpireOption()

Get the `ExpireOption` instance.

getType()

getType()

getContextKey()

getContextKey()

Get the context key for cache. Presets should be saved per-language.