class AbstractTokenSubscriber implements EventSubscriberInterface

Class AbstractTokenSubscriber

Properties

string $entity
array $tokenNames

Methods

static 
getSubscribedEvents()

No description

__construct($entity, array $tokenNames = array())

No description

bool
checkActive( $processor)

Determine whether this token-handler should be used with the given processor.

registerTokens( $e)

Register the declared tokens.

array
getCustomTokens(string $entity)

Get all custom field tokens of $entity

alterActionScheduleQuery( $e)

Alter the query which prepopulates mailing data for scheduled reminders.

evaluateTokens( $e)

Populate the token data.

mixed
prefetch( $e)

To perform a bulk lookup before rendering tokens, override this function and return the prefetched data.

mixed
evaluateToken( $row, string $entity, string $field, mixed $prefetch = NULL)

Evaluate the content of a single token.

Details

at line 57
static getSubscribedEvents()

at line 82
__construct($entity, array $tokenNames = array())

Parameters

$entity
array $tokenNames Array(string $fieldName => string $label).

at line 97
bool checkActive( $processor)

Determine whether this token-handler should be used with the given processor.

To short-circuit token-processing in irrelevant contexts, override this.

Parameters

$processor

Return Value

bool

at line 107
registerTokens( $e)

Register the declared tokens.

Parameters

$e The registration event. Add new tokens using register().

at line 127
array getCustomTokens(string $entity)

Get all custom field tokens of $entity

Parameters

string $entity

Return Value

array $customTokens return custom field tokens in array('custom_N' => 'label') format

at line 147
alterActionScheduleQuery( $e)

Alter the query which prepopulates mailing data for scheduled reminders.

This is method is not always appropriate, but if you're specifically focused on scheduled reminders, it can be convenient.

Parameters

$e The pending query which may be modified. See discussion on MailingQueryEvent::$query.

at line 156
evaluateTokens( $e)

Populate the token data.

Parameters

$e The event, which includes a list of rows and tokens.

at line 185
mixed prefetch( $e)

To perform a bulk lookup before rendering tokens, override this function and return the prefetched data.

Parameters

$e

Return Value

mixed

at line 202
abstract mixed evaluateToken( $row, string $entity, string $field, mixed $prefetch = NULL)

Evaluate the content of a single token.

Parameters

$row The record for which we want token values.
string $entity The name of the token entity.
string $field The name of the token field.
mixed $prefetch Any data that was returned by the prefetch().

Return Value

mixed