Documentation

MappingBase extends AutoSubscriber
in package
implements MappingInterface

AbstractYes

Base implementation of MappingInterface.

Extend this class to register a new type of ActionSchedule mapping. Note: When choosing a value to return from getId(), use a "machine name" style string.

Table of Contents

Interfaces

MappingInterface
Interface MappingInterface

Methods

applies()  : bool
checkAccess()  : bool
Check if the user has permission to create a reminder for given `entity_value`.
getAlternateRecipients()  : array<string|int, mixed>|null
getBccRecipients()  : array<string|int, mixed>|null
getDateFields()  : array<string|int, mixed>
Get option list for `start_action_date` & `end_date` fields.
getEntity()  : string
Deprecated ambiguously-named function.
getEntityTable()  : string
Name of the table belonging to the main entity e.g. `civicrm_activity`
getId()  : string|int
Unique identifier of this mapping type.
getLabel()  : string
Label of this mapping type as shown in the "Entity" dropdown-select on the form.
getLimitToOptions()  : array<string|int, mixed>
Get the option list for `limit_to` (non-associative format)
getRecipientListing()  : array<string|int, mixed>
Get option list for `recipient_listing` field.
getRecipientTypes()  : array<string|int, mixed>
Get option list for `recipient` field.
getSubscribedEvents()  : array<string|int, mixed>
modifyApiSpec()  : mixed
modifySpec()  : void
onRegisterActionMappings()  : void
Register this action mapping type with CRM_Core_BAO_ActionSchedule.
resetOnTriggerDateChange()  : bool
Determine whether a schedule based on this mapping should reset the reminder state if the trigger date changes.
sendToAdditional()  : bool
Determine whether a schedule based on this mapping should send to additional contacts.
getFixedRecipients()  : array<string|int, mixed>|null

Methods

applies()

public final applies(string $entity, string $action) : bool
Parameters
$entity : string
$action : string
Return values
bool

checkAccess()

Check if the user has permission to create a reminder for given `entity_value`.

public checkAccess(array<string|int, mixed> $entityValue) : bool

This function is called by the form to escalate permissions so that less-privileged users can create a reminder for a particular entity even if they do not have 'administer CiviCRM data'.

Return FALSE and the default permission of 'administer CiviCRM data' will be enforced.

Note that entity_value is a serialized field, so will be passed as an array, even though more than one value doesn't make sense in the context of embedding the ScheduledReminder form on a page belonging to a single entity.

Parameters
$entityValue : array<string|int, mixed>
Return values
bool

getDateFields()

Get option list for `start_action_date` & `end_date` fields.

public getDateFields([array<string|int, mixed>|null $entityValue = NULL ]) : array<string|int, mixed>
Parameters
$entityValue : array<string|int, mixed>|null = NULL

Selected value(s) of the entity_value field.

Return values
array<string|int, mixed>

getEntity()

Deprecated ambiguously-named function.

public getEntity() : string
Return values
string

getId()

Unique identifier of this mapping type.

public getId() : string|int

Should return a "machine_name" style string (same output as getName()) Note: Some legacy implementations return an int. Don't follow those examples.

Return values
string|int

getLabel()

Label of this mapping type as shown in the "Entity" dropdown-select on the form.

public getLabel() : string
Return values
string

getLimitToOptions()

Get the option list for `limit_to` (non-associative format)

public static getLimitToOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRecipientListing()

Get option list for `recipient_listing` field.

public getRecipientListing(mixed $recipientType) : array<string|int, mixed>
Parameters
$recipientType : mixed

Value of recipient field

Return values
array<string|int, mixed>

Ex: [1 => 'Attendee', 2 => 'Volunteer', ...].

getRecipientTypes()

Get option list for `recipient` field.

public static getRecipientTypes() : array<string|int, mixed>

Note: A single schedule may filter on zero or one recipient types. When an admin chooses a value, it's stored in $schedule->recipient.

Return values
array<string|int, mixed>

Ex: ['assignee' => 'Activity Assignee', ...].

getSubscribedEvents()

public static getSubscribedEvents() : array<string|int, mixed>
Return values
array<string|int, mixed>

resetOnTriggerDateChange()

Determine whether a schedule based on this mapping should reset the reminder state if the trigger date changes.

public resetOnTriggerDateChange(mixed $schedule) : bool
Parameters
$schedule : mixed
Return values
bool

sendToAdditional()

Determine whether a schedule based on this mapping should send to additional contacts.

public sendToAdditional(mixed $entityId) : bool
Parameters
$entityId : mixed
Return values
bool

        
On this page

Search results