UserConsent
in package
Uses
UtilsProvider
Handle consents of users.
Table of Contents
Constants
- BY_CRITERIA_RESULT_TYPE_COUNT = 'count'
- BY_CRITERIA_RESULT_TYPE_JSON_DECODE = 'jsonDecode'
- BY_CRITERIA_RESULT_TYPE_SQL_QUERY = 'sqlQuery'
- CLICKABLE_BUTTONS = ['none', 'main_all', 'main_essential', 'main_close_icon', 'main_custom', 'ind_all', 'ind_essential', 'ind_close_icon', 'ind_custom', 'implicit_all', 'implicit_essential', \DevOwl\RealCookieBanner\view\shortcode\LinkShortcode::BUTTON_CLICKED_IDENTIFIER, \DevOwl\RealCookieBanner\view\Blocker::BUTTON_CLICKED_IDENTIFIER]
- TABLE_NAME = 'consent_v2'
- TABLE_NAME_DECISION = 'consent_decision'
- TABLE_NAME_DEPRECATED = 'consent'
- The old table name for saved consents.
- TABLE_NAME_IP = 'consent_ip'
- TABLE_NAME_TCF_STRING = 'consent_tcf_string'
- TABLE_NAME_URL = 'consent_url'
Properties
- $me : UserConsent
- Singleton instance.
Methods
- byCriteria() : mixed
- Fetch user consents by criteria.
- castReadRows() : mixed
- Cast read rows from database to correct types.
- getCount() : mixed
- Get the total count of current consents.
- getInstance() : mixed
- Get singleton instance.
- getPersistedContexts() : array<string|int, string>
- Get all persisted contexts so they can be used e. g. to query statistics.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- getReferer() : array<string|int, string>
- Get all referer across all consents.
- getTruncatedIpsCount() : mixed
- Check if there are truncated IPs saved in the current consents list and return the count of found rows.
- purge() : bool|array<string|int, mixed>
- Delete all available user consents with revisions and stats.
- scheduleDeletionOfConsents() : mixed
- Delete consents older than set duration time
- settings_updated() : mixed
- Settings got updated in "Settings" tab, lets reschedule deletion of consents.
- toPersistedTransactionInstance() : mixed
- Convert a row object read by `byCriteria` to a `PersistedTransaction`.
- __construct() : mixed
- C'tor.
- deleteConsentsByConsentDurationPeriod() : mixed
- Executing query for deletion consents
Constants
BY_CRITERIA_RESULT_TYPE_COUNT
public
mixed
BY_CRITERIA_RESULT_TYPE_COUNT
= 'count'
BY_CRITERIA_RESULT_TYPE_JSON_DECODE
public
mixed
BY_CRITERIA_RESULT_TYPE_JSON_DECODE
= 'jsonDecode'
BY_CRITERIA_RESULT_TYPE_SQL_QUERY
public
mixed
BY_CRITERIA_RESULT_TYPE_SQL_QUERY
= 'sqlQuery'
CLICKABLE_BUTTONS
public
mixed
CLICKABLE_BUTTONS
= ['none', 'main_all', 'main_essential', 'main_close_icon', 'main_custom', 'ind_all', 'ind_essential', 'ind_close_icon', 'ind_custom', 'implicit_all', 'implicit_essential', \DevOwl\RealCookieBanner\view\shortcode\LinkShortcode::BUTTON_CLICKED_IDENTIFIER, \DevOwl\RealCookieBanner\view\Blocker::BUTTON_CLICKED_IDENTIFIER]
TABLE_NAME
public
mixed
TABLE_NAME
= 'consent_v2'
TABLE_NAME_DECISION
public
mixed
TABLE_NAME_DECISION
= 'consent_decision'
TABLE_NAME_DEPRECATED
The old table name for saved consents.
public
mixed
TABLE_NAME_DEPRECATED
= 'consent'
Tags
TABLE_NAME_IP
public
mixed
TABLE_NAME_IP
= 'consent_ip'
TABLE_NAME_TCF_STRING
public
mixed
TABLE_NAME_TCF_STRING
= 'consent_tcf_string'
TABLE_NAME_URL
public
mixed
TABLE_NAME_URL
= 'consent_url'
Properties
$me
Singleton instance.
private
static UserConsent
$me
= null
Methods
byCriteria()
Fetch user consents by criteria.
public
byCriteria(array<string|int, mixed> $args[, string $returnType = self::BY_CRITERIA_RESULT_TYPE_JSON_DECODE ]) : mixed
Parameters
- $args : array<string|int, mixed>
-
'uuid', 'uuids', 'ip', 'exactIp', 'offset', 'perPage', 'from', 'to', 'pure_referer', 'context'
- $returnType : string = self::BY_CRITERIA_RESULT_TYPE_JSON_DECODE
castReadRows()
Cast read rows from database to correct types.
public
castReadRows(array<string|int, object> &$results[, bool $jsonDecode = true ]) : mixed
Parameters
- $results : array<string|int, object>
- $jsonDecode : bool = true
-
Pass
false
if you do not want to decode data likerevision
ordecision
to real objects (useful for CSV exports)
getCount()
Get the total count of current consents.
public
getCount() : mixed
getInstance()
Get singleton instance.
public
static getInstance() : mixed
Tags
getPersistedContexts()
Get all persisted contexts so they can be used e. g. to query statistics.
public
getPersistedContexts() : array<string|int, string>
Return values
array<string|int, string>getPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringgetReferer()
Get all referer across all consents.
public
getReferer() : array<string|int, string>
Return values
array<string|int, string>getTruncatedIpsCount()
Check if there are truncated IPs saved in the current consents list and return the count of found rows.
public
getTruncatedIpsCount() : mixed
purge()
Delete all available user consents with revisions and stats.
public
purge() : bool|array<string|int, mixed>
Return values
bool|array<string|int, mixed> —Array with deleted counts of the database tables
scheduleDeletionOfConsents()
Delete consents older than set duration time
public
scheduleDeletionOfConsents() : mixed
settings_updated()
Settings got updated in "Settings" tab, lets reschedule deletion of consents.
public
settings_updated(WP_HTTP_Response $response) : mixed
Parameters
- $response : WP_HTTP_Response
toPersistedTransactionInstance()
Convert a row object read by `byCriteria` to a `PersistedTransaction`.
public
toPersistedTransactionInstance(object $row) : mixed
Parameters
- $row : object
__construct()
C'tor.
private
__construct() : mixed
deleteConsentsByConsentDurationPeriod()
Executing query for deletion consents
private
deleteConsentsByConsentDurationPeriod() : mixed