MatchPluginCallbacks
in package
Provide an object for a given match with match-callbacks which can be used within plugins.
This is similar to callback of HeadlessContentBlocker
, but individual to a match.
This class does not contain yet all plugin APIs as from AbstractPlugin
, but will be
implemented as needed.
Table of Contents
Properties
- $blockedMatchCallbacks : mixed
- $keepAlwaysAttributes : mixed
- $match : mixed
Methods
- __construct() : mixed
- C'tor.
- addBlockedMatchCallback() : mixed
- Add a callable after a blocked match got found so you can alter the match again. Parameters: `BlockedResult $result, MatchPluginCallbacks $matchPluginCallbacks, AbstractMatcher $matcher`.
- addKeepAlwaysAttributes() : mixed
- In some cases we need to keep the attributes as original instead of prefix it with `consent-original-`.
- getFromMatch() : MatchPluginCallbacks
- We are using `AbstractMatch#data` to retrieve and set the plugin callbacks instance, lazily.
- getKeepAlwaysAttributes() : mixed
- Getter.
- getMatch() : mixed
- Getter.
- runBlockedMatchCallback() : mixed
- Run registered blocked-match callbacks.
Properties
$blockedMatchCallbacks
private
mixed
$blockedMatchCallbacks
= []
$keepAlwaysAttributes
private
mixed
$keepAlwaysAttributes
= []
$match
private
mixed
$match
Methods
__construct()
C'tor.
public
__construct(AbstractMatch $match) : mixed
Parameters
- $match : AbstractMatch
addBlockedMatchCallback()
Add a callable after a blocked match got found so you can alter the match again. Parameters: `BlockedResult $result, MatchPluginCallbacks $matchPluginCallbacks, AbstractMatcher $matcher`.
public
addBlockedMatchCallback(callable $callback) : mixed
Parameters
- $callback : callable
addKeepAlwaysAttributes()
In some cases we need to keep the attributes as original instead of prefix it with `consent-original-`.
public
addKeepAlwaysAttributes(array<string|int, string> $attributes) : mixed
Keep in mind, that no external data should be loaded if the attribute is set!
Parameters
- $attributes : array<string|int, string>
getFromMatch()
We are using `AbstractMatch#data` to retrieve and set the plugin callbacks instance, lazily.
public
static getFromMatch(AbstractMatch $match) : MatchPluginCallbacks
Parameters
- $match : AbstractMatch
Return values
MatchPluginCallbacksgetKeepAlwaysAttributes()
Getter.
public
getKeepAlwaysAttributes() : mixed
Tags
getMatch()
Getter.
public
getMatch() : mixed
Tags
runBlockedMatchCallback()
Run registered blocked-match callbacks.
public
runBlockedMatchCallback(BlockedResult $result, AbstractMatcher $matcher) : mixed
Parameters
- $result : BlockedResult
- $matcher : AbstractMatcher