if ($_action_mapping === NULL) {
$event = \Civi::dispatcher()
- ->dispatch(\Civi\ActionSchedule\Events::MAPPINGS,
+ ->dispatch('civi.actionSchedule.getMappings',
new \Civi\ActionSchedule\Event\MappingRegisterEvent());
$_action_mapping = $event->getMappings();
}
\Civi::dispatcher()
->dispatch(
- \Civi\ActionSchedule\Events::MAILING_QUERY,
+ 'civi.actionSchedule.prepareMailingQuery',
new \Civi\ActionSchedule\Event\MailingQueryEvent($actionSchedule, $mapping, $select)
);
*
* (Note: When adding more JOINs, it seems typical to use !casMailingJoinType, although
* some hard-code a LEFT JOIN. Don't have an explanation for why.)
+ *
+ * Event name: 'civi.actionSchedule.prepareMailingQuery'
*/
class MailingQueryEvent extends Event {
* @package Civi\ActionSchedule\Event
*
* Register any available mappings.
+ *
+ * Event name: 'civi.actionSchedule.getMappings'
*/
class MappingRegisterEvent extends Event {
class Events {
/**
- * Register any available mappings.
- *
- * @see EntityListEvent
+ * @see \Civi\ActionSchedule\Event\MappingRegisterEvent
+ * @deprecated - You may simply use the event name directly. dev/core#1744
*/
const MAPPINGS = 'civi.actionSchedule.getMappings';
/**
- * Prepare the pre-mailing query. This query loads details about
- * the contact/entity so that they're available for mail-merge.
+ * @see \Civi\ActionSchedule\Event\MailingQueryEvent
+ * @deprecated - You may simply use the event name directly. dev/core#1744
*/
const MAILING_QUERY = 'civi.actionSchedule.prepareMailingQuery';
'CRM_Core_LegacyErrorHandler',
'handleException',
], -200);
- $dispatcher->addListener(\Civi\ActionSchedule\Events::MAPPINGS, ['CRM_Activity_ActionMapping', 'onRegisterActionMappings']);
- $dispatcher->addListener(\Civi\ActionSchedule\Events::MAPPINGS, ['CRM_Contact_ActionMapping', 'onRegisterActionMappings']);
- $dispatcher->addListener(\Civi\ActionSchedule\Events::MAPPINGS, ['CRM_Contribute_ActionMapping_ByPage', 'onRegisterActionMappings']);
- $dispatcher->addListener(\Civi\ActionSchedule\Events::MAPPINGS, ['CRM_Contribute_ActionMapping_ByType', 'onRegisterActionMappings']);
- $dispatcher->addListener(\Civi\ActionSchedule\Events::MAPPINGS, ['CRM_Event_ActionMapping', 'onRegisterActionMappings']);
- $dispatcher->addListener(\Civi\ActionSchedule\Events::MAPPINGS, ['CRM_Member_ActionMapping', 'onRegisterActionMappings']);
+ $dispatcher->addListener('civi.actionSchedule.getMappings', ['CRM_Activity_ActionMapping', 'onRegisterActionMappings']);
+ $dispatcher->addListener('civi.actionSchedule.getMappings', ['CRM_Contact_ActionMapping', 'onRegisterActionMappings']);
+ $dispatcher->addListener('civi.actionSchedule.getMappings', ['CRM_Contribute_ActionMapping_ByPage', 'onRegisterActionMappings']);
+ $dispatcher->addListener('civi.actionSchedule.getMappings', ['CRM_Contribute_ActionMapping_ByType', 'onRegisterActionMappings']);
+ $dispatcher->addListener('civi.actionSchedule.getMappings', ['CRM_Event_ActionMapping', 'onRegisterActionMappings']);
+ $dispatcher->addListener('civi.actionSchedule.getMappings', ['CRM_Member_ActionMapping', 'onRegisterActionMappings']);
return $dispatcher;
}
return [
'civi.token.list' => 'registerTokens',
'civi.token.eval' => 'evaluateTokens',
- \Civi\ActionSchedule\Events::MAILING_QUERY => 'alterActionScheduleQuery',
+ 'civi.actionSchedule.prepareMailingQuery' => 'alterActionScheduleQuery',
];
}