From bc6ba616ca8880265e5309ff40186ed64e732f53 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 11 Aug 2021 13:46:38 -0700 Subject: [PATCH] (NFC) MailingQueryEvent - Add more docblocks about query-writing and `tokenContext_*` --- Civi/ActionSchedule/Event/MailingQueryEvent.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Civi/ActionSchedule/Event/MailingQueryEvent.php b/Civi/ActionSchedule/Event/MailingQueryEvent.php index 8739514169..bd6324c429 100644 --- a/Civi/ActionSchedule/Event/MailingQueryEvent.php +++ b/Civi/ActionSchedule/Event/MailingQueryEvent.php @@ -28,6 +28,18 @@ use Symfony\Component\EventDispatcher\Event; * ->select('foo.bar_value AS bar'); * ``` * + * Modifications may be used to do the following: + * + * - Joining to business tables - to help target filter-criteria/temporal criteria on other entites. + * (Ex: Join to the `civicrm_participant` table and filter on participant status or registration date.) + * - Joining business tables - to select/return additional columns. Feed the data downstream for mail-merge/token-handling. As in: + * - (Recommended) Return the IDs of business-records. Use the prefix `tokenContext_*`. + * Ex query: `$event->query->select('foo.id AS tokenContext_fooId') + * Ex output: `$tokenRow->context['fooId']` + * - (Deprecated) Return detailed data of business-records. Ex: + * Ex query: `$event->query->select('foo.title as foo_title, foo.status_id as foo_status_id')` + * Ex output: `$tokenRow->context['actionSearchResult']->foo_title` + * * There are several parameters pre-set for use in queries: * - 'casActionScheduleId' * - 'casEntityJoinExpr' - eg 'e.id = reminder.entity_id' -- 2.25.1