class CRM_Activity_Tokens extends AbstractTokenSubscriber

Class CRM_Member_Tokens

Generate "activity.*" tokens.

This TokenSubscriber was produced by refactoring the code from the scheduled-reminder system with the goal of making that system more flexible. The current implementation is still coupled to scheduled-reminders. It would be good to figure out a more generic implementation which is not tied to scheduled reminders, although that is outside the current scope.

Properties

string $entity from AbstractTokenSubscriber
array $tokenNames from AbstractTokenSubscriber
array $activeTokens from AbstractTokenSubscriber

Methods

static 
getSubscribedEvents()

No description

__construct()

CRM_Activity_Tokens constructor.

bool
checkActive(TokenProcessor $processor)

No description

registerTokens(TokenRegisterEvent $e)

Register the declared tokens.

evaluateTokens(TokenValueEvent $e)

Populate the token data.

mixed
getActiveTokens(TokenValueEvent $e)

To handle variable tokens, override this function and return the active tokens.

mixed
prefetch(TokenValueEvent $e)

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

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

No description

array
getBasicTokens()

Get the basic tokens provided.

array
getCustomFieldTokens()

Get the tokens for custom fields

Details

static getSubscribedEvents()

at line 51
__construct()

CRM_Activity_Tokens constructor.

at line 61
bool checkActive(TokenProcessor $processor)

Parameters

TokenProcessor $processor

Return Value

bool

registerTokens(TokenRegisterEvent $e)

Register the declared tokens.

Parameters

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

at line 70
alterActionScheduleQuery(MailingQueryEvent $e)

Parameters

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

evaluateTokens(TokenValueEvent $e)

Populate the token data.

Parameters

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

mixed getActiveTokens(TokenValueEvent $e)

To handle variable tokens, override this function and return the active tokens.

Parameters

TokenValueEvent $e

Return Value

mixed

mixed prefetch(TokenValueEvent $e)

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

Parameters

TokenValueEvent $e

Return Value

mixed

at line 98
mixed evaluateToken(TokenRow $row, string $entity, string $field, mixed $prefetch = NULL)

Parameters

TokenRow $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

at line 120
protected array getBasicTokens()

Get the basic tokens provided.

Return Value

array token name => token label

at line 134
protected array getCustomFieldTokens()

Get the tokens for custom fields

Return Value

array token name => token label