Documentation

ImpliedContextSubscriber
in package
implements EventSubscriberInterface

Suppose you have `$context['participantId']`. You can infer a corresponding `$context['eventId']`. The ImpliedContextSubscriber reads values like `participantId` and fills-in values like `eventId`.

Table of Contents

Interfaces

EventSubscriberInterface

Methods

getSubscribedEvents()  : mixed
onEvaluateTokens()  : void
When evaluating tokens, ensure that implied data is loaded.
onRegisterTokens()  : void
When listing tokens, ensure that implied data is visible.
findRelevantMappings()  : iterable<string|int, mixed>
Are there any context-fields for which we should do lookups?
getMappings()  : iterable<string|int, mixed>

Methods

onEvaluateTokens()

When evaluating tokens, ensure that implied data is loaded.

public onEvaluateTokens(TokenValueEvent $e) : void

Ex: If $context['participantId'] is supplied, then lookup the corresponding $context['eventId'].

This fires early during the civi.token.list process to ensure that other listeners see the autoloaded values.

Parameters
$e : TokenValueEvent

onRegisterTokens()

When listing tokens, ensure that implied data is visible.

public onRegisterTokens(TokenRegisterEvent $e) : void

Ex: If $context['participantId'] is part of the schema, then $context['eventId'] will also be part of the schema.

This fires early during the civi.token.list process to ensure that other listeners see the updated schema.

Parameters
$e : TokenRegisterEvent

findRelevantMappings()

Are there any context-fields for which we should do lookups?

private findRelevantMappings(TokenProcessor $tokenProcessor) : iterable<string|int, mixed>

Ex: If the $tokenProcessor has the participantIds, then we would want to know any rules that involve participantId. But we don't need to know rules that involve contributionId.

Parameters
$tokenProcessor : TokenProcessor
Return values
iterable<string|int, mixed>

getMappings()

private getMappings() : iterable<string|int, mixed>
Return values
iterable<string|int, mixed>

        
On this page

Search results