3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2019 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2019
35 class CRM_Event_BAO_Query
extends CRM_Core_BAO_Query
{
38 * Function get the import/export fields for contribution.
40 * @param bool $checkPermission
43 * Associative array of contribution fields
45 public static function &getFields($checkPermission = TRUE) {
47 $fields = array_merge($fields, CRM_Event_DAO_Event
::import());
48 $fields = array_merge($fields, self
::getParticipantFields());
49 $fields = array_merge($fields, CRM_Core_DAO_Discount
::export());
50 $fields['event'] = self
::getPseudoEventDateFieldMetadata();
57 public static function getParticipantFields() {
58 return CRM_Event_BAO_Participant
::importableFields('Individual', TRUE, TRUE);
62 * Build select for CiviEvent.
66 public static function select(&$query) {
67 if (($query->_mode
& CRM_Contact_BAO_Query
::MODE_EVENT
) ||
68 CRM_Contact_BAO_Query
::componentPresent($query->_returnProperties
, 'participant_')
70 $query->_select
['participant_id'] = "civicrm_participant.id as participant_id";
71 $query->_element
['participant_id'] = 1;
72 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
75 if (!empty($query->_returnProperties
['participant_fee_level'])) {
76 $query->_select
['participant_fee_level'] = "civicrm_participant.fee_level as participant_fee_level";
77 $query->_element
['participant_fee_level'] = 1;
80 //add participant contact ID
81 if (!empty($query->_returnProperties
['participant_contact_id'])) {
82 $query->_select
['participant_contact_id'] = "civicrm_participant.contact_id as participant_contact_id";
83 $query->_element
['participant_contact_id'] = 1;
87 if (!empty($query->_returnProperties
['participant_fee_amount'])) {
88 $query->_select
['participant_fee_amount'] = "civicrm_participant.fee_amount as participant_fee_amount";
89 $query->_element
['participant_fee_amount'] = 1;
93 if (!empty($query->_returnProperties
['participant_fee_currency'])) {
94 $query->_select
['participant_fee_currency'] = "civicrm_participant.fee_currency as participant_fee_currency";
95 $query->_element
['participant_fee_currency'] = 1;
98 //add event title also if event id is select
99 if (!empty($query->_returnProperties
['event_id']) ||
!empty($query->_returnProperties
['event_title'])) {
100 $query->_select
['event_id'] = "civicrm_event.id as event_id";
101 $query->_select
['event_title'] = "civicrm_event.title as event_title";
102 $query->_element
['event_id'] = 1;
103 $query->_element
['event_title'] = 1;
104 $query->_tables
['civicrm_event'] = 1;
105 $query->_whereTables
['civicrm_event'] = 1;
108 //add start date / end date
109 if (!empty($query->_returnProperties
['event_start_date'])) {
110 $query->_select
['event_start_date'] = "civicrm_event.start_date as event_start_date";
111 $query->_element
['event_start_date'] = 1;
114 if (!empty($query->_returnProperties
['event_end_date'])) {
115 $query->_select
['event_end_date'] = "civicrm_event.end_date as event_end_date";
116 $query->_element
['event_end_date'] = 1;
120 if (!empty($query->_returnProperties
['event_type'])) {
121 $query->_select
['event_type'] = "event_type.label as event_type";
122 $query->_element
['event_type'] = 1;
123 $query->_tables
['event_type'] = 1;
124 $query->_whereTables
['event_type'] = 1;
127 if (!empty($query->_returnProperties
['event_type_id'])) {
128 $query->_select
['event_type_id'] = "civicrm_event.event_type_id as event_type_id";
129 $query->_element
['event_type_id'] = 1;
130 $query->_tables
['civicrm_event'] = 1;
131 $query->_whereTables
['civicrm_event'] = 1;
135 if (!empty($query->_returnProperties
['participant_status_id'])) {
136 $query->_select
['participant_status_id'] = "civicrm_participant.status_id as participant_status_id";
137 $query->_element
['participant_status_id'] = 1;
138 $query->_tables
['civicrm_participant'] = 1;
139 $query->_whereTables
['civicrm_participant'] = 1;
142 // get particupant_status label
143 if (!empty($query->_returnProperties
['participant_status'])) {
144 $query->_select
['participant_status'] = "participant_status.label as participant_status";
145 $query->_element
['participant_status'] = 1;
146 $query->_tables
['participant_status'] = 1;
147 $query->_whereTables
['civicrm_participant'] = 1;
150 //add participant_role_id
151 if (!empty($query->_returnProperties
['participant_role_id'])) {
152 $query->_select
['participant_role_id'] = "civicrm_participant.role_id as participant_role_id";
153 $query->_element
['participant_role_id'] = 1;
154 $query->_tables
['civicrm_participant'] = 1;
155 $query->_whereTables
['civicrm_participant'] = 1;
156 $query->_pseudoConstantsSelect
['participant_role_id'] = [
157 'pseudoField' => 'participant_role_id',
158 'idCol' => 'participant_role_id',
162 //add participant_role
163 if (!empty($query->_returnProperties
['participant_role'])) {
164 $query->_select
['participant_role'] = "civicrm_participant.role_id as participant_role";
165 $query->_element
['participant_role'] = 1;
166 $query->_tables
['participant_role'] = 1;
167 $query->_whereTables
['civicrm_participant'] = 1;
168 $query->_pseudoConstantsSelect
['participant_role'] = [
169 'pseudoField' => 'participant_role',
170 'idCol' => 'participant_role',
175 if (!empty($query->_returnProperties
['participant_register_date'])) {
176 $query->_select
['participant_register_date'] = "civicrm_participant.register_date as participant_register_date";
177 $query->_element
['participant_register_date'] = 1;
181 if (!empty($query->_returnProperties
['participant_source'])) {
182 $query->_select
['participant_source'] = "civicrm_participant.source as participant_source";
183 $query->_element
['participant_source'] = 1;
184 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
188 if (!empty($query->_returnProperties
['participant_note'])) {
189 $query->_select
['participant_note'] = "participant_note.note as participant_note";
190 $query->_element
['participant_note'] = 1;
191 $query->_tables
['participant_note'] = 1;
192 $query->_whereTables
['participant_note'] = 1;
195 if (!empty($query->_returnProperties
['participant_is_pay_later'])) {
196 $query->_select
['participant_is_pay_later'] = "civicrm_participant.is_pay_later as participant_is_pay_later";
197 $query->_element
['participant_is_pay_later'] = 1;
200 if (!empty($query->_returnProperties
['participant_is_test'])) {
201 $query->_select
['participant_is_test'] = "civicrm_participant.is_test as participant_is_test";
202 $query->_element
['participant_is_test'] = 1;
205 if (!empty($query->_returnProperties
['participant_registered_by_id'])) {
206 $query->_select
['participant_registered_by_id'] = "civicrm_participant.registered_by_id as participant_registered_by_id";
207 $query->_element
['participant_registered_by_id'] = 1;
211 if (!empty($query->_returnProperties
['participant_discount_name'])) {
212 $query->_select
['participant_discount_name'] = "discount_name.title as participant_discount_name";
213 $query->_element
['participant_discount_name'] = 1;
214 $query->_tables
['civicrm_discount'] = 1;
215 $query->_tables
['participant_discount_name'] = 1;
216 $query->_whereTables
['civicrm_discount'] = 1;
217 $query->_whereTables
['participant_discount_name'] = 1;
220 //carry campaign id to selectors.
221 if (!empty($query->_returnProperties
['participant_campaign_id'])) {
222 $query->_select
['participant_campaign_id'] = 'civicrm_participant.campaign_id as participant_campaign_id';
223 $query->_element
['participant_campaign_id'] = 1;
231 public static function where(&$query) {
233 foreach (array_keys($query->_params
) as $id) {
234 if (empty($query->_params
[$id][0])) {
237 if (substr($query->_params
[$id][0], 0, 6) == 'event_' ||
238 substr($query->_params
[$id][0], 0, 12) == 'participant_'
240 if ($query->_mode
== CRM_Contact_BAO_Query
::MODE_CONTACTS
) {
241 $query->_useDistinct
= TRUE;
243 $grouping = $query->_params
[$id][3];
244 self
::whereClauseSingle($query->_params
[$id], $query);
251 * @param \CRM_Contact_BAO_Query $query
253 public static function whereClauseSingle(&$values, &$query) {
254 $checkPermission = empty($query->_skipPermission
);
255 list($name, $op, $value, $grouping, $wildcard) = $values;
256 $fields = array_merge(CRM_Event_BAO_Event
::fields(), CRM_Event_BAO_Participant
::exportableFields());
261 $query->dateQueryBuilder($values,
262 'civicrm_event', 'event', 'start_date', ts('Event Active On'), TRUE, 'YmdHis', 'end_date'
266 case 'event_start_date_low':
267 case 'event_start_date_high':
268 $query->dateQueryBuilder($values,
269 'civicrm_event', 'event_start_date', 'start_date', 'Start Date'
273 case 'event_end_date_low':
274 case 'event_end_date_high':
275 $query->dateQueryBuilder($values,
276 'civicrm_event', 'event_end_date', 'end_date', 'End Date'
280 case 'event_include_repeating_events':
282 * Include Repeating Events
284 //Get parent of this event
286 if ($query->_where
[$grouping]) {
287 foreach ($query->_where
[$grouping] as $key => $val) {
288 if (strstr($val, 'civicrm_event.id =')) {
290 $extractEventId = explode(" ", $val);
291 $value = $extractEventId[2];
292 $where = $query->_where
[$grouping][$key];
294 elseif (strstr($val, 'civicrm_event.id IN')) {
295 //extract the first event id if multiple events are selected
296 preg_match('/civicrm_event.id IN \(\"(\d+)/', $val, $matches);
297 $value = $matches[1];
298 $where = $query->_where
[$grouping][$key];
302 $extractEventId = explode(" ", $exEventId);
303 $value = $extractEventId[2];
305 elseif (!empty($matches[1])) {
306 $value = $matches[1];
308 $where = $query->_where
[$grouping][$key];
310 $thisEventHasParent = CRM_Core_BAO_RecurringEntity
::getParentFor($value, 'civicrm_event');
311 if ($thisEventHasParent) {
312 $getAllConnections = CRM_Core_BAO_RecurringEntity
::getEntitiesForParent($thisEventHasParent, 'civicrm_event');
314 foreach ($getAllConnections as $key => $val) {
315 $allEventIds[] = $val['id'];
317 if (!empty($allEventIds)) {
319 $value = "(" . implode(",", $allEventIds) . ")";
322 $query->_where
[$grouping][] = "{$where} OR civicrm_event.id $op {$value}";
323 $query->_qill
[$grouping][] = ts('Include Repeating Events');
324 $query->_tables
['civicrm_event'] = $query->_whereTables
['civicrm_event'] = 1;
327 case 'participant_is_test':
328 $key = array_search('civicrm_participant.is_test = 0', $query->_where
[$grouping]);
330 unset($query->_where
[$grouping][$key]);
332 case 'participant_test':
333 // We dont want to include all tests for sql OR CRM-7827
334 if (!$value ||
$query->getOperator() != 'OR') {
335 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause("civicrm_participant.is_test",
341 $isTest = $value ?
'a Test' : 'not a Test';
342 $query->_qill
[$grouping][] = ts("Participant is %1", [1 => $isTest]);
343 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
347 case 'participant_fee_id':
349 foreach ($value as $val) {
350 $labels[] = CRM_Core_DAO
::getFieldValue('CRM_Price_DAO_PriceFieldValue', $val, 'label');
352 $query->_where
[$grouping][] = "civicrm_line_item.price_field_value_id IN (" . implode(', ', $value) . ")";
353 $query->_qill
[$grouping][] = ts("Fee level") . " IN " . implode(', ', $labels);
354 $query->_tables
['civicrm_participant'] = $query->_tables
['civicrm_line_item'] = $query->_whereTables
['civicrm_line_item'] = 1;
357 case 'participant_fee_amount_high':
358 case 'participant_fee_amount_low':
359 $query->numberRangeBuilder($values,
360 'civicrm_participant', 'participant_fee_amount', 'fee_amount', 'Fee Amount'
364 case 'participant_status_id':
365 if ($value && is_array($value) && strpos($op, 'IN') === FALSE) {
368 case 'participant_status':
369 case 'participant_source':
370 case 'participant_id':
371 case 'participant_contact_id':
372 case 'participant_is_pay_later':
373 case 'participant_fee_amount':
374 case 'participant_fee_level':
375 case 'participant_campaign_id':
376 case 'participant_registered_by_id':
379 if (in_array($name, [
380 'participant_status_id',
381 'participant_source',
383 'participant_contact_id',
384 'participant_fee_amount',
385 'participant_fee_level',
386 'participant_is_pay_later',
387 'participant_campaign_id',
388 'participant_registered_by_id',
390 $name = str_replace('participant_', '', $name);
391 if ($name == 'is_pay_later') {
395 elseif ($name == 'participant_status') {
399 $dataType = !empty($fields[$qillName]['type']) ? CRM_Utils_Type
::typeToString($fields[$qillName]['type']) : 'String';
400 $tableName = empty($tableName) ?
'civicrm_participant' : $tableName;
401 if (is_array($value) && in_array(key($value), CRM_Core_DAO
::acceptedSQLOperators(), TRUE)) {
403 $value = $value[$op];
405 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause("$tableName.$name", $op, $value, $dataType);
407 list($op, $value) = CRM_Contact_BAO_Query
::buildQillForFieldValue('CRM_Event_DAO_Participant', $name, $value, $op);
408 $query->_qill
[$grouping][] = ts('%1 %2 %3', [1 => $fields[$qillName]['title'], 2 => $op, 3 => $value]);
409 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
412 case 'participant_role':
413 case 'participant_role_id':
417 $dataType = !empty($fields[$qillName]['type']) ? CRM_Utils_Type
::typeToString($fields[$qillName]['type']) : 'String';
418 $tableName = empty($tableName) ?
'civicrm_participant' : $tableName;
419 if (is_array($value) && in_array(key($value), CRM_Core_DAO
::acceptedSQLOperators(), TRUE)) {
421 $value = $value[$op];
423 if (!strstr($op, 'NULL') && !strstr($op, 'EMPTY') && !strstr($op, 'LIKE')) {
424 $regexOp = (strstr($op, '!') ||
strstr($op, 'NOT')) ?
'NOT REGEXP' : 'REGEXP';
425 $regexp = "([[:cntrl:]]|^)" . implode('([[:cntrl:]]|$)|([[:cntrl:]]|^)', (array) $value) . "([[:cntrl:]]|$)";
426 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause("civicrm_participant.$name", $regexOp, $regexp, 'String');
429 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause("$tableName.$name", $op, $value, $dataType);
432 list($op, $value) = CRM_Contact_BAO_Query
::buildQillForFieldValue('CRM_Event_DAO_Participant', $name, $value, $op);
433 $query->_qill
[$grouping][] = ts('%1 %2 %3', [1 => $fields[$qillName]['title'], 2 => $op, 3 => $value]);
434 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
437 case 'participant_register_date':
438 case 'participant_register_date_high':
439 case 'participant_register_date_low':
440 $query->dateQueryBuilder($values,
441 'civicrm_participant', 'participant_register_date', 'register_date', 'Register Date'
446 case 'participant_event_id':
447 $name = str_replace('participant_', '', $name);
448 case 'event_is_public':
449 case 'event_type_id':
452 if (in_array($name, [
457 $name = str_replace('event_', '', $name);
459 $dataType = !empty($fields[$qillName]['type']) ? CRM_Utils_Type
::typeToString($fields[$qillName]['type']) : 'String';
461 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause("civicrm_event.$name", $op, $value, $dataType);
462 $query->_tables
['civicrm_event'] = $query->_whereTables
['civicrm_event'] = 1;
463 if (!array_key_exists($qillName, $fields)) {
466 list($op, $value) = CRM_Contact_BAO_Query
::buildQillForFieldValue('CRM_Event_DAO_Event', $name, $value, $op, ['check_permission' => $checkPermission]);
467 $query->_qill
[$grouping][] = ts('%1 %2 %3', [1 => $fields[$qillName]['title'], 2 => $op, 3 => $value]);
470 case 'participant_note':
471 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
472 $query->_tables
['participant_note'] = $query->_whereTables
['participant_note'] = 1;
473 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause('participant_note.note', $op, $value, 'String');
474 $query->_qill
[$grouping][] = ts('%1 %2 %3', [1 => $fields[$name]['title'], 2 => $op, 3 => $value]);
480 * @param string $name
484 * @return null|string
486 public static function from($name, $mode, $side) {
489 case 'civicrm_participant':
490 $from = " LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id ";
493 case 'civicrm_event':
495 $from = " LEFT JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id ";
499 $from = " $side JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type')";
500 $from .= " $side JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id ) ";
503 case 'participant_note':
504 $from .= " $side JOIN civicrm_note participant_note ON ( participant_note.entity_table = 'civicrm_participant' AND
505 civicrm_participant.id = participant_note.entity_id )";
508 case 'participant_status':
509 $from .= " $side JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id) ";
512 case 'participant_role':
513 $from = " $side JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role')";
514 $from .= " $side JOIN civicrm_option_value participant_role ON ((civicrm_participant.role_id = participant_role.value OR SUBSTRING_INDEX(role_id,'\ 1', 1) = participant_role.value)
515 AND option_group_participant_role.id = participant_role.option_group_id ) ";
518 case 'participant_discount_name':
519 $from = " $side JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id )";
520 $from .= " $side JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id ) ";
523 case 'civicrm_line_item':
524 $from .= " $side JOIN civicrm_line_item ON civicrm_line_item.entity_id = civicrm_participant.id AND civicrm_line_item.entity_table = 'civicrm_participant'";
532 * @param bool $includeCustomFields
536 public static function defaultReturnProperties(
538 $includeCustomFields = TRUE
541 if ($mode & CRM_Contact_BAO_Query
::MODE_EVENT
) {
544 'contact_sub_type' => 1,
549 'event_start_date' => 1,
550 'event_end_date' => 1,
552 'participant_id' => 1,
553 'participant_status' => 1,
554 'participant_status_id' => 1,
555 'participant_role' => 1,
556 'participant_role_id' => 1,
557 'participant_note' => 1,
558 'participant_register_date' => 1,
559 'participant_source' => 1,
560 'participant_fee_level' => 1,
561 'participant_is_test' => 1,
562 'participant_is_pay_later' => 1,
563 'participant_fee_amount' => 1,
564 'participant_discount_name' => 1,
565 'participant_fee_currency' => 1,
566 'participant_registered_by_id' => 1,
567 'participant_campaign_id' => 1,
570 if ($includeCustomFields) {
571 // also get all the custom participant properties
572 $fields = CRM_Core_BAO_CustomField
::getFieldsForImport('Participant');
573 if (!empty($fields)) {
574 foreach ($fields as $name => $dontCare) {
575 $properties[$name] = 1;
585 * Get the metadata for fields to be included on the grant search form.
587 * @throws \CiviCRM_API3_Exception
589 public static function getSearchFieldMetadata() {
591 'participant_status_id',
592 'participant_register_date',
593 // Super-weird but we have to make it work.....
596 $metadata = civicrm_api3('Participant', 'getfields', [])['values'];
597 $metadata['event'] = self
::getPseudoEventDateFieldMetadata();
598 return array_intersect_key($metadata, array_flip($fields));
602 * Build the event search form.
604 * @param \CRM_Event_Form_Search $form
606 * @throws \CiviCRM_API3_Exception
607 * @throws \CRM_Core_Exception
609 public static function buildSearchForm(&$form) {
610 $form->addSearchFieldMetadata(['Participant' => self
::getSearchFieldMetadata()]);
611 $form->addFormFieldsFromMetadata();
612 $dataURLEventFee = CRM_Utils_System
::url('civicrm/ajax/eventFee',
617 $form->assign('dataURLEventFee', $dataURLEventFee);
619 $form->addEntityRef('event_id', ts('Event Name'), [
621 'placeholder' => ts('- any -'),
623 'select' => ['minimumInputLength' => 0],
625 $form->addEntityRef('event_type_id', ts('Event Type'), [
626 'entity' => 'OptionValue',
627 'placeholder' => ts('- any -'),
628 'select' => ['minimumInputLength' => 0],
630 'params' => ['option_group_id' => 'event_type'],
633 $obj = new CRM_Report_Form_Event_ParticipantListing();
634 $form->add('select', 'participant_fee_id',
636 $obj->getPriceLevels(),
637 FALSE, ['class' => 'crm-select2', 'multiple' => 'multiple', 'placeholder' => ts('- any -')]
640 $form->addElement('checkbox', "event_include_repeating_events", NULL, ts('Include participants from all events in the %1 series', [1 => '<em>%1</em>']));
642 $form->addSelect('participant_role_id',
644 'entity' => 'participant',
645 'label' => ts('Participant Role'),
646 'multiple' => 'multiple',
647 'option_url' => NULL,
648 'placeholder' => ts('- any -'),
652 $form->addYesNo('participant_test', ts('Participant is a Test?'), TRUE);
653 $form->addYesNo('participant_is_pay_later', ts('Participant is Pay Later?'), TRUE);
654 $form->addElement('text', 'participant_fee_amount_low', ts('From'), ['size' => 8, 'maxlength' => 8]);
655 $form->addElement('text', 'participant_fee_amount_high', ts('To'), ['size' => 8, 'maxlength' => 8]);
657 $form->addRule('participant_fee_amount_low', ts('Please enter a valid money value.'), 'money');
658 $form->addRule('participant_fee_amount_high', ts('Please enter a valid money value.'), 'money');
660 self
::addCustomFormFields($form, ['Participant', 'Event']);
662 CRM_Campaign_BAO_Campaign
::addCampaignInComponentSearch($form, 'participant_campaign_id');
664 $form->assign('validCiviEvent', TRUE);
665 $form->setDefaults(['participant_test' => 0]);
671 public static function tableNames(&$tables) {
672 //add participant table
673 if (!empty($tables['civicrm_event'])) {
674 $tables = array_merge(['civicrm_participant' => 1], $tables);
679 * Get metadata from pseudo search field 'event'.
683 protected static function getPseudoEventDateFieldMetadata(): array {
686 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
687 'title' => ts('Event Active On'),
688 'table_name' => 'civicrm_event',
689 'where' => 'civicrm_event.start_date',
690 'where_end' => 'civicrm_event.end_date',
691 'html' => ['type' => 'SelectDate', 'formatType' => 'activityDateTime'],