Merge pull request #14894 from eileenmcnaughton/date_fisc
[civicrm-core.git] / CRM / Core / DAO / ActionSchedule.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
6b83d5bd 5 * @copyright CiviCRM LLC (c) 2004-2019
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Core/ActionSchedule.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
74db51d3 9 * (GenCodeChecksum:aee88e50a306c0ae2d2aa373ec6c0af5)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the ActionSchedule entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
fa45b5b9 22 public static $_tableName = 'civicrm_action_schedule';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
fa45b5b9 29 public static $_log = FALSE;
c3fc2621 30
e501603b 31 /**
e6ca0a57 32 * @var int
e501603b
TO
33 */
34 public $id;
c3fc2621 35
e501603b
TO
36 /**
37 * Name of the action(reminder)
38 *
39 * @var string
40 */
41 public $name;
c3fc2621 42
e501603b
TO
43 /**
44 * Title of the action(reminder)
45 *
46 * @var string
47 */
48 public $title;
c3fc2621 49
e501603b
TO
50 /**
51 * Recipient
52 *
53 * @var string
54 */
55 public $recipient;
c3fc2621 56
e501603b
TO
57 /**
58 * Is this the recipient criteria limited to OR in addition to?
59 *
e6ca0a57 60 * @var bool
e501603b
TO
61 */
62 public $limit_to;
c3fc2621 63
e501603b
TO
64 /**
65 * Entity value
66 *
67 * @var string
68 */
69 public $entity_value;
c3fc2621 70
e501603b
TO
71 /**
72 * Entity status
73 *
74 * @var string
75 */
76 public $entity_status;
c3fc2621 77
e501603b
TO
78 /**
79 * Reminder Interval.
80 *
e6ca0a57 81 * @var int
e501603b
TO
82 */
83 public $start_action_offset;
c3fc2621 84
e501603b
TO
85 /**
86 * Time units for reminder.
87 *
88 * @var string
89 */
90 public $start_action_unit;
c3fc2621 91
e501603b
TO
92 /**
93 * Reminder Action
94 *
95 * @var string
96 */
97 public $start_action_condition;
c3fc2621 98
e501603b
TO
99 /**
100 * Entity date
101 *
102 * @var string
103 */
104 public $start_action_date;
c3fc2621 105
e501603b 106 /**
e6ca0a57 107 * @var bool
e501603b
TO
108 */
109 public $is_repeat;
c3fc2621 110
e501603b
TO
111 /**
112 * Time units for repetition of reminder.
113 *
114 * @var string
115 */
116 public $repetition_frequency_unit;
c3fc2621 117
e501603b
TO
118 /**
119 * Time interval for repeating the reminder.
120 *
e6ca0a57 121 * @var int
e501603b
TO
122 */
123 public $repetition_frequency_interval;
c3fc2621 124
e501603b
TO
125 /**
126 * Time units till repetition of reminder.
127 *
128 * @var string
129 */
130 public $end_frequency_unit;
c3fc2621 131
e501603b
TO
132 /**
133 * Time interval till repeating the reminder.
134 *
e6ca0a57 135 * @var int
e501603b
TO
136 */
137 public $end_frequency_interval;
c3fc2621 138
e501603b
TO
139 /**
140 * Reminder Action till repeating the reminder.
141 *
142 * @var string
143 */
144 public $end_action;
c3fc2621 145
e501603b
TO
146 /**
147 * Entity end date
148 *
149 * @var string
150 */
151 public $end_date;
c3fc2621 152
e501603b
TO
153 /**
154 * Is this option active?
155 *
e6ca0a57 156 * @var bool
e501603b
TO
157 */
158 public $is_active;
c3fc2621 159
e501603b
TO
160 /**
161 * Contact IDs to which reminder should be sent.
162 *
163 * @var string
164 */
165 public $recipient_manual;
c3fc2621 166
e501603b
TO
167 /**
168 * listing based on recipient field.
169 *
170 * @var string
171 */
172 public $recipient_listing;
c3fc2621 173
e501603b
TO
174 /**
175 * Body of the mailing in text format.
176 *
177 * @var longtext
178 */
179 public $body_text;
c3fc2621 180
e501603b
TO
181 /**
182 * Body of the mailing in html format.
183 *
184 * @var longtext
185 */
186 public $body_html;
c3fc2621 187
e501603b
TO
188 /**
189 * Content of the SMS text.
190 *
191 * @var longtext
192 */
193 public $sms_body_text;
c3fc2621 194
e501603b
TO
195 /**
196 * Subject of mailing
197 *
198 * @var string
199 */
200 public $subject;
c3fc2621 201
e501603b
TO
202 /**
203 * Record Activity for this reminder?
204 *
e6ca0a57 205 * @var bool
e501603b
TO
206 */
207 public $record_activity;
c3fc2621 208
e501603b
TO
209 /**
210 * Name/ID of the mapping to use on this table
211 *
212 * @var string
213 */
214 public $mapping_id;
c3fc2621 215
e501603b
TO
216 /**
217 * FK to Group
218 *
e6ca0a57 219 * @var int
e501603b
TO
220 */
221 public $group_id;
c3fc2621 222
e501603b
TO
223 /**
224 * FK to the message template.
225 *
e6ca0a57 226 * @var int
e501603b
TO
227 */
228 public $msg_template_id;
c3fc2621 229
e501603b
TO
230 /**
231 * FK to the message template.
232 *
e6ca0a57 233 * @var int
e501603b
TO
234 */
235 public $sms_template_id;
c3fc2621 236
e501603b
TO
237 /**
238 * Date on which the reminder be sent.
239 *
240 * @var date
241 */
242 public $absolute_date;
c3fc2621 243
e501603b
TO
244 /**
245 * Name in "from" field
246 *
247 * @var string
248 */
249 public $from_name;
c3fc2621 250
e501603b
TO
251 /**
252 * Email address in "from" field
253 *
254 * @var string
255 */
256 public $from_email;
c3fc2621 257
e501603b
TO
258 /**
259 * Send the message as email or sms or both.
260 *
261 * @var string
262 */
263 public $mode;
c3fc2621 264
e501603b 265 /**
e6ca0a57 266 * @var int
e501603b
TO
267 */
268 public $sms_provider_id;
c3fc2621 269
e501603b
TO
270 /**
271 * Used for repeating entity
272 *
273 * @var string
274 */
275 public $used_for;
c3fc2621 276
e501603b
TO
277 /**
278 * Used for multilingual installation
279 *
280 * @var string
281 */
282 public $filter_contact_language;
c3fc2621 283
e501603b
TO
284 /**
285 * Used for multilingual installation
286 *
287 * @var string
288 */
289 public $communication_language;
c3fc2621 290
e501603b 291 /**
f41f0342 292 * Class constructor.
e501603b 293 */
c3fc2621 294 public function __construct() {
e501603b
TO
295 $this->__table = 'civicrm_action_schedule';
296 parent::__construct();
297 }
c3fc2621 298
e501603b 299 /**
f41f0342 300 * Returns foreign keys and entity references.
e501603b
TO
301 *
302 * @return array
303 * [CRM_Core_Reference_Interface]
304 */
c3fc2621 305 public static function getReferenceColumns() {
346aaaba 306 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 307 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621
CW
308 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'group_id', 'civicrm_group', 'id');
309 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id');
310 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'sms_template_id', 'civicrm_msg_template', 'id');
311 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id');
346aaaba 312 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 313 }
346aaaba 314 return Civi::$statics[__CLASS__]['links'];
e501603b 315 }
c3fc2621 316
e501603b
TO
317 /**
318 * Returns all the column names of this table
319 *
320 * @return array
321 */
c3fc2621 322 public static function &fields() {
346aaaba 323 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
324 Civi::$statics[__CLASS__]['fields'] = [
325 'id' => [
e501603b
TO
326 'name' => 'id',
327 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
328 'title' => ts('Action Schedule ID'),
329 'required' => TRUE,
a36434b9 330 'where' => 'civicrm_action_schedule.id',
522a26c9 331 'table_name' => 'civicrm_action_schedule',
332 'entity' => 'ActionSchedule',
333 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 334 'localizable' => 0,
c3fc2621
CW
335 ],
336 'name' => [
e501603b
TO
337 'name' => 'name',
338 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 339 'title' => ts('Name'),
215b423e 340 'description' => ts('Name of the action(reminder)'),
e501603b
TO
341 'maxlength' => 64,
342 'size' => CRM_Utils_Type::BIG,
a36434b9 343 'where' => 'civicrm_action_schedule.name',
522a26c9 344 'table_name' => 'civicrm_action_schedule',
345 'entity' => 'ActionSchedule',
346 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 347 'localizable' => 0,
c3fc2621
CW
348 ],
349 'title' => [
e501603b
TO
350 'name' => 'title',
351 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 352 'title' => ts('Title'),
215b423e 353 'description' => ts('Title of the action(reminder)'),
e501603b
TO
354 'maxlength' => 64,
355 'size' => CRM_Utils_Type::BIG,
a36434b9 356 'where' => 'civicrm_action_schedule.title',
522a26c9 357 'table_name' => 'civicrm_action_schedule',
358 'entity' => 'ActionSchedule',
359 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 360 'localizable' => 0,
c3fc2621
CW
361 ],
362 'recipient' => [
e501603b
TO
363 'name' => 'recipient',
364 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 365 'title' => ts('Recipient'),
215b423e 366 'description' => ts('Recipient'),
e501603b
TO
367 'maxlength' => 64,
368 'size' => CRM_Utils_Type::BIG,
a36434b9 369 'where' => 'civicrm_action_schedule.recipient',
522a26c9 370 'table_name' => 'civicrm_action_schedule',
371 'entity' => 'ActionSchedule',
372 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 373 'localizable' => 0,
c3fc2621
CW
374 ],
375 'limit_to' => [
e501603b
TO
376 'name' => 'limit_to',
377 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 378 'title' => ts('Limit To'),
215b423e 379 'description' => ts('Is this the recipient criteria limited to OR in addition to?'),
a36434b9 380 'where' => 'civicrm_action_schedule.limit_to',
522a26c9 381 'table_name' => 'civicrm_action_schedule',
382 'entity' => 'ActionSchedule',
383 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 384 'localizable' => 0,
c3fc2621
CW
385 ],
386 'entity_value' => [
e501603b
TO
387 'name' => 'entity_value',
388 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 389 'title' => ts('Entity Value'),
215b423e 390 'description' => ts('Entity value'),
e501603b
TO
391 'maxlength' => 255,
392 'size' => CRM_Utils_Type::HUGE,
a36434b9 393 'where' => 'civicrm_action_schedule.entity_value',
522a26c9 394 'table_name' => 'civicrm_action_schedule',
395 'entity' => 'ActionSchedule',
396 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 397 'localizable' => 0,
c3fc2621
CW
398 ],
399 'entity_status' => [
e501603b
TO
400 'name' => 'entity_status',
401 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 402 'title' => ts('Entity Status'),
215b423e 403 'description' => ts('Entity status'),
e501603b
TO
404 'maxlength' => 64,
405 'size' => CRM_Utils_Type::BIG,
a36434b9 406 'where' => 'civicrm_action_schedule.entity_status',
522a26c9 407 'table_name' => 'civicrm_action_schedule',
408 'entity' => 'ActionSchedule',
409 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 410 'localizable' => 0,
c3fc2621
CW
411 ],
412 'start_action_offset' => [
e501603b
TO
413 'name' => 'start_action_offset',
414 'type' => CRM_Utils_Type::T_INT,
c3fc2621 415 'title' => ts('Start Action Offset'),
215b423e 416 'description' => ts('Reminder Interval.'),
a36434b9 417 'where' => 'civicrm_action_schedule.start_action_offset',
45a83e42 418 'default' => '0',
522a26c9 419 'table_name' => 'civicrm_action_schedule',
420 'entity' => 'ActionSchedule',
421 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 422 'localizable' => 0,
c3fc2621
CW
423 ],
424 'start_action_unit' => [
e501603b
TO
425 'name' => 'start_action_unit',
426 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 427 'title' => ts('Start Action Unit'),
215b423e 428 'description' => ts('Time units for reminder.'),
e501603b
TO
429 'maxlength' => 8,
430 'size' => CRM_Utils_Type::EIGHT,
a36434b9 431 'where' => 'civicrm_action_schedule.start_action_unit',
522a26c9 432 'table_name' => 'civicrm_action_schedule',
433 'entity' => 'ActionSchedule',
434 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 435 'localizable' => 0,
c3fc2621 436 'html' => [
e501603b 437 'type' => 'Select',
c3fc2621
CW
438 ],
439 'pseudoconstant' => [
e501603b 440 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
e6ca0a57 441 ],
c3fc2621
CW
442 ],
443 'start_action_condition' => [
e501603b
TO
444 'name' => 'start_action_condition',
445 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 446 'title' => ts('Start Action Condition'),
215b423e 447 'description' => ts('Reminder Action'),
ed6e48d9 448 'maxlength' => 64,
449 'size' => CRM_Utils_Type::BIG,
a36434b9 450 'where' => 'civicrm_action_schedule.start_action_condition',
522a26c9 451 'table_name' => 'civicrm_action_schedule',
452 'entity' => 'ActionSchedule',
453 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 454 'localizable' => 0,
c3fc2621
CW
455 ],
456 'start_action_date' => [
e501603b
TO
457 'name' => 'start_action_date',
458 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 459 'title' => ts('Start Action Date'),
215b423e 460 'description' => ts('Entity date'),
e501603b
TO
461 'maxlength' => 64,
462 'size' => CRM_Utils_Type::BIG,
a36434b9 463 'where' => 'civicrm_action_schedule.start_action_date',
522a26c9 464 'table_name' => 'civicrm_action_schedule',
465 'entity' => 'ActionSchedule',
466 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 467 'localizable' => 0,
c3fc2621
CW
468 ],
469 'is_repeat' => [
e501603b
TO
470 'name' => 'is_repeat',
471 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 472 'title' => ts('Repeat?'),
a36434b9 473 'where' => 'civicrm_action_schedule.is_repeat',
45a83e42 474 'default' => '0',
522a26c9 475 'table_name' => 'civicrm_action_schedule',
476 'entity' => 'ActionSchedule',
477 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 478 'localizable' => 0,
c3fc2621
CW
479 ],
480 'repetition_frequency_unit' => [
e501603b
TO
481 'name' => 'repetition_frequency_unit',
482 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 483 'title' => ts('Repetition Frequency Unit'),
215b423e 484 'description' => ts('Time units for repetition of reminder.'),
e501603b
TO
485 'maxlength' => 8,
486 'size' => CRM_Utils_Type::EIGHT,
a36434b9 487 'where' => 'civicrm_action_schedule.repetition_frequency_unit',
522a26c9 488 'table_name' => 'civicrm_action_schedule',
489 'entity' => 'ActionSchedule',
490 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 491 'localizable' => 0,
c3fc2621 492 'html' => [
e501603b 493 'type' => 'Select',
c3fc2621
CW
494 ],
495 'pseudoconstant' => [
e501603b 496 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
e6ca0a57 497 ],
c3fc2621
CW
498 ],
499 'repetition_frequency_interval' => [
e501603b
TO
500 'name' => 'repetition_frequency_interval',
501 'type' => CRM_Utils_Type::T_INT,
c3fc2621 502 'title' => ts('Repetition Frequency Interval'),
215b423e 503 'description' => ts('Time interval for repeating the reminder.'),
a36434b9 504 'where' => 'civicrm_action_schedule.repetition_frequency_interval',
45a83e42 505 'default' => '0',
522a26c9 506 'table_name' => 'civicrm_action_schedule',
507 'entity' => 'ActionSchedule',
508 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 509 'localizable' => 0,
c3fc2621
CW
510 ],
511 'end_frequency_unit' => [
e501603b
TO
512 'name' => 'end_frequency_unit',
513 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 514 'title' => ts('End Frequency Unit'),
215b423e 515 'description' => ts('Time units till repetition of reminder.'),
e501603b
TO
516 'maxlength' => 8,
517 'size' => CRM_Utils_Type::EIGHT,
a36434b9 518 'where' => 'civicrm_action_schedule.end_frequency_unit',
522a26c9 519 'table_name' => 'civicrm_action_schedule',
520 'entity' => 'ActionSchedule',
521 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 522 'localizable' => 0,
c3fc2621 523 'html' => [
e501603b 524 'type' => 'Select',
c3fc2621
CW
525 ],
526 'pseudoconstant' => [
e501603b 527 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
e6ca0a57 528 ],
c3fc2621
CW
529 ],
530 'end_frequency_interval' => [
e501603b
TO
531 'name' => 'end_frequency_interval',
532 'type' => CRM_Utils_Type::T_INT,
c3fc2621 533 'title' => ts('End Frequency Interval'),
215b423e 534 'description' => ts('Time interval till repeating the reminder.'),
a36434b9 535 'where' => 'civicrm_action_schedule.end_frequency_interval',
45a83e42 536 'default' => '0',
522a26c9 537 'table_name' => 'civicrm_action_schedule',
538 'entity' => 'ActionSchedule',
539 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 540 'localizable' => 0,
c3fc2621
CW
541 ],
542 'end_action' => [
e501603b
TO
543 'name' => 'end_action',
544 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 545 'title' => ts('End Action'),
215b423e 546 'description' => ts('Reminder Action till repeating the reminder.'),
e501603b
TO
547 'maxlength' => 32,
548 'size' => CRM_Utils_Type::MEDIUM,
a36434b9 549 'where' => 'civicrm_action_schedule.end_action',
522a26c9 550 'table_name' => 'civicrm_action_schedule',
551 'entity' => 'ActionSchedule',
552 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 553 'localizable' => 0,
c3fc2621
CW
554 ],
555 'end_date' => [
e501603b
TO
556 'name' => 'end_date',
557 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 558 'title' => ts('End Date'),
215b423e 559 'description' => ts('Entity end date'),
e501603b
TO
560 'maxlength' => 64,
561 'size' => CRM_Utils_Type::BIG,
a36434b9 562 'where' => 'civicrm_action_schedule.end_date',
522a26c9 563 'table_name' => 'civicrm_action_schedule',
564 'entity' => 'ActionSchedule',
565 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 566 'localizable' => 0,
c3fc2621
CW
567 ],
568 'is_active' => [
e501603b
TO
569 'name' => 'is_active',
570 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 571 'title' => ts('Schedule is Active?'),
215b423e 572 'description' => ts('Is this option active?'),
a36434b9 573 'where' => 'civicrm_action_schedule.is_active',
e501603b 574 'default' => '1',
522a26c9 575 'table_name' => 'civicrm_action_schedule',
576 'entity' => 'ActionSchedule',
577 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 578 'localizable' => 0,
c3fc2621
CW
579 ],
580 'recipient_manual' => [
e501603b
TO
581 'name' => 'recipient_manual',
582 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 583 'title' => ts('Recipient Manual'),
215b423e 584 'description' => ts('Contact IDs to which reminder should be sent.'),
e501603b
TO
585 'maxlength' => 128,
586 'size' => CRM_Utils_Type::HUGE,
a36434b9 587 'where' => 'civicrm_action_schedule.recipient_manual',
522a26c9 588 'table_name' => 'civicrm_action_schedule',
589 'entity' => 'ActionSchedule',
590 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 591 'localizable' => 0,
c3fc2621
CW
592 ],
593 'recipient_listing' => [
e501603b
TO
594 'name' => 'recipient_listing',
595 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 596 'title' => ts('Recipient Listing'),
215b423e 597 'description' => ts('listing based on recipient field.'),
e501603b
TO
598 'maxlength' => 128,
599 'size' => CRM_Utils_Type::HUGE,
a36434b9 600 'where' => 'civicrm_action_schedule.recipient_listing',
522a26c9 601 'table_name' => 'civicrm_action_schedule',
602 'entity' => 'ActionSchedule',
603 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 604 'localizable' => 0,
c3fc2621
CW
605 ],
606 'body_text' => [
e501603b
TO
607 'name' => 'body_text',
608 'type' => CRM_Utils_Type::T_LONGTEXT,
c3fc2621 609 'title' => ts('Reminder Text'),
215b423e 610 'description' => ts('Body of the mailing in text format.'),
a36434b9 611 'where' => 'civicrm_action_schedule.body_text',
522a26c9 612 'table_name' => 'civicrm_action_schedule',
613 'entity' => 'ActionSchedule',
614 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 615 'localizable' => 0,
c3fc2621
CW
616 ],
617 'body_html' => [
e501603b
TO
618 'name' => 'body_html',
619 'type' => CRM_Utils_Type::T_LONGTEXT,
c3fc2621 620 'title' => ts('Reminder HTML'),
215b423e 621 'description' => ts('Body of the mailing in html format.'),
a36434b9 622 'where' => 'civicrm_action_schedule.body_html',
522a26c9 623 'table_name' => 'civicrm_action_schedule',
624 'entity' => 'ActionSchedule',
625 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 626 'localizable' => 0,
c3fc2621
CW
627 ],
628 'sms_body_text' => [
e501603b
TO
629 'name' => 'sms_body_text',
630 'type' => CRM_Utils_Type::T_LONGTEXT,
c3fc2621 631 'title' => ts('SMS Reminder Text'),
215b423e 632 'description' => ts('Content of the SMS text.'),
a36434b9 633 'where' => 'civicrm_action_schedule.sms_body_text',
522a26c9 634 'table_name' => 'civicrm_action_schedule',
635 'entity' => 'ActionSchedule',
636 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 637 'localizable' => 0,
c3fc2621
CW
638 ],
639 'subject' => [
e501603b
TO
640 'name' => 'subject',
641 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 642 'title' => ts('Reminder Subject'),
215b423e 643 'description' => ts('Subject of mailing'),
e501603b
TO
644 'maxlength' => 128,
645 'size' => CRM_Utils_Type::HUGE,
a36434b9 646 'where' => 'civicrm_action_schedule.subject',
522a26c9 647 'table_name' => 'civicrm_action_schedule',
648 'entity' => 'ActionSchedule',
649 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 650 'localizable' => 0,
c3fc2621
CW
651 ],
652 'record_activity' => [
e501603b
TO
653 'name' => 'record_activity',
654 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 655 'title' => ts('Record Activity for Reminder?'),
215b423e 656 'description' => ts('Record Activity for this reminder?'),
a36434b9 657 'where' => 'civicrm_action_schedule.record_activity',
e501603b 658 'default' => 'NULL',
522a26c9 659 'table_name' => 'civicrm_action_schedule',
660 'entity' => 'ActionSchedule',
661 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 662 'localizable' => 0,
c3fc2621
CW
663 ],
664 'mapping_id' => [
e501603b
TO
665 'name' => 'mapping_id',
666 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 667 'title' => ts('Reminder Mapping'),
215b423e 668 'description' => ts('Name/ID of the mapping to use on this table'),
e501603b
TO
669 'maxlength' => 64,
670 'size' => CRM_Utils_Type::BIG,
a36434b9 671 'where' => 'civicrm_action_schedule.mapping_id',
522a26c9 672 'table_name' => 'civicrm_action_schedule',
673 'entity' => 'ActionSchedule',
674 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 675 'localizable' => 0,
c3fc2621
CW
676 ],
677 'group_id' => [
e501603b
TO
678 'name' => 'group_id',
679 'type' => CRM_Utils_Type::T_INT,
c3fc2621 680 'title' => ts('Reminder Group'),
215b423e 681 'description' => ts('FK to Group'),
a36434b9 682 'where' => 'civicrm_action_schedule.group_id',
522a26c9 683 'table_name' => 'civicrm_action_schedule',
684 'entity' => 'ActionSchedule',
685 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 686 'localizable' => 0,
e501603b 687 'FKClassName' => 'CRM_Contact_DAO_Group',
c3fc2621 688 'html' => [
e501603b 689 'type' => 'Select',
c3fc2621
CW
690 ],
691 'pseudoconstant' => [
e501603b
TO
692 'table' => 'civicrm_group',
693 'keyColumn' => 'id',
694 'labelColumn' => 'title',
e6ca0a57 695 ],
c3fc2621
CW
696 ],
697 'msg_template_id' => [
e501603b
TO
698 'name' => 'msg_template_id',
699 'type' => CRM_Utils_Type::T_INT,
c3fc2621 700 'title' => ts('Reminder Template'),
215b423e 701 'description' => ts('FK to the message template.'),
a36434b9 702 'where' => 'civicrm_action_schedule.msg_template_id',
522a26c9 703 'table_name' => 'civicrm_action_schedule',
704 'entity' => 'ActionSchedule',
705 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 706 'localizable' => 0,
e501603b 707 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
c3fc2621
CW
708 ],
709 'sms_template_id' => [
e501603b
TO
710 'name' => 'sms_template_id',
711 'type' => CRM_Utils_Type::T_INT,
c3fc2621 712 'title' => ts('SMS Reminder Template'),
215b423e 713 'description' => ts('FK to the message template.'),
a36434b9 714 'where' => 'civicrm_action_schedule.sms_template_id',
522a26c9 715 'table_name' => 'civicrm_action_schedule',
716 'entity' => 'ActionSchedule',
717 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 718 'localizable' => 0,
e501603b 719 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
c3fc2621
CW
720 ],
721 'absolute_date' => [
e501603b
TO
722 'name' => 'absolute_date',
723 'type' => CRM_Utils_Type::T_DATE,
c3fc2621 724 'title' => ts('Fixed Date for Reminder'),
215b423e 725 'description' => ts('Date on which the reminder be sent.'),
a36434b9 726 'where' => 'civicrm_action_schedule.absolute_date',
522a26c9 727 'table_name' => 'civicrm_action_schedule',
728 'entity' => 'ActionSchedule',
729 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 730 'localizable' => 0,
c3fc2621
CW
731 ],
732 'from_name' => [
e501603b
TO
733 'name' => 'from_name',
734 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 735 'title' => ts('Reminder from Name'),
215b423e 736 'description' => ts('Name in "from" field'),
e501603b
TO
737 'maxlength' => 255,
738 'size' => CRM_Utils_Type::HUGE,
a36434b9 739 'where' => 'civicrm_action_schedule.from_name',
522a26c9 740 'table_name' => 'civicrm_action_schedule',
741 'entity' => 'ActionSchedule',
742 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 743 'localizable' => 0,
c3fc2621
CW
744 ],
745 'from_email' => [
e501603b
TO
746 'name' => 'from_email',
747 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 748 'title' => ts('Reminder From Email'),
215b423e 749 'description' => ts('Email address in "from" field'),
e501603b
TO
750 'maxlength' => 255,
751 'size' => CRM_Utils_Type::HUGE,
a36434b9 752 'where' => 'civicrm_action_schedule.from_email',
522a26c9 753 'table_name' => 'civicrm_action_schedule',
754 'entity' => 'ActionSchedule',
755 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 756 'localizable' => 0,
c3fc2621
CW
757 ],
758 'mode' => [
e501603b
TO
759 'name' => 'mode',
760 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 761 'title' => ts('Message Mode'),
215b423e 762 'description' => ts('Send the message as email or sms or both.'),
e501603b
TO
763 'maxlength' => 128,
764 'size' => CRM_Utils_Type::HUGE,
a36434b9 765 'where' => 'civicrm_action_schedule.mode',
e501603b 766 'default' => 'Email',
522a26c9 767 'table_name' => 'civicrm_action_schedule',
768 'entity' => 'ActionSchedule',
769 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 770 'localizable' => 0,
c3fc2621 771 'html' => [
e501603b 772 'type' => 'Select',
c3fc2621
CW
773 ],
774 'pseudoconstant' => [
e501603b
TO
775 'optionGroupName' => 'msg_mode',
776 'optionEditPath' => 'civicrm/admin/options/msg_mode',
e6ca0a57 777 ],
c3fc2621
CW
778 ],
779 'sms_provider_id' => [
e501603b
TO
780 'name' => 'sms_provider_id',
781 'type' => CRM_Utils_Type::T_INT,
c3fc2621 782 'title' => ts('SMS Provider'),
a36434b9 783 'where' => 'civicrm_action_schedule.sms_provider_id',
522a26c9 784 'table_name' => 'civicrm_action_schedule',
785 'entity' => 'ActionSchedule',
786 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 787 'localizable' => 0,
e501603b 788 'FKClassName' => 'CRM_SMS_DAO_Provider',
c3fc2621 789 'html' => [
e501603b 790 'type' => 'Select',
c3fc2621
CW
791 ],
792 ],
793 'used_for' => [
e501603b
TO
794 'name' => 'used_for',
795 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 796 'title' => ts('Used For'),
215b423e 797 'description' => ts('Used for repeating entity'),
e501603b
TO
798 'maxlength' => 64,
799 'size' => CRM_Utils_Type::BIG,
a36434b9 800 'where' => 'civicrm_action_schedule.used_for',
522a26c9 801 'table_name' => 'civicrm_action_schedule',
802 'entity' => 'ActionSchedule',
803 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 804 'localizable' => 0,
c3fc2621
CW
805 ],
806 'filter_contact_language' => [
e501603b
TO
807 'name' => 'filter_contact_language',
808 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 809 'title' => ts('Filter Contact Language'),
215b423e 810 'description' => ts('Used for multilingual installation'),
e501603b
TO
811 'maxlength' => 128,
812 'size' => CRM_Utils_Type::HUGE,
a36434b9 813 'where' => 'civicrm_action_schedule.filter_contact_language',
522a26c9 814 'table_name' => 'civicrm_action_schedule',
815 'entity' => 'ActionSchedule',
816 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 817 'localizable' => 0,
c3fc2621
CW
818 ],
819 'communication_language' => [
e501603b
TO
820 'name' => 'communication_language',
821 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 822 'title' => ts('Communication Language'),
215b423e 823 'description' => ts('Used for multilingual installation'),
e501603b
TO
824 'maxlength' => 8,
825 'size' => CRM_Utils_Type::EIGHT,
a36434b9 826 'where' => 'civicrm_action_schedule.communication_language',
522a26c9 827 'table_name' => 'civicrm_action_schedule',
828 'entity' => 'ActionSchedule',
829 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 830 'localizable' => 0,
c3fc2621
CW
831 ],
832 ];
346aaaba 833 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 834 }
346aaaba 835 return Civi::$statics[__CLASS__]['fields'];
e501603b 836 }
c3fc2621 837
e501603b 838 /**
bd8e0b14 839 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
840 *
841 * @return array
bd8e0b14 842 * Array(string $name => string $uniqueName).
e501603b 843 */
c3fc2621 844 public static function &fieldKeys() {
bd8e0b14
TO
845 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
846 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 847 }
bd8e0b14 848 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 849 }
c3fc2621 850
e501603b
TO
851 /**
852 * Returns the names of this table
853 *
854 * @return string
855 */
c3fc2621 856 public static function getTableName() {
e501603b
TO
857 return self::$_tableName;
858 }
c3fc2621 859
e501603b
TO
860 /**
861 * Returns if this table needs to be logged
862 *
c3fc2621 863 * @return bool
e501603b 864 */
c3fc2621 865 public function getLog() {
e501603b
TO
866 return self::$_log;
867 }
c3fc2621 868
e501603b
TO
869 /**
870 * Returns the list of fields that can be imported
871 *
872 * @param bool $prefix
873 *
874 * @return array
875 */
c3fc2621
CW
876 public static function &import($prefix = FALSE) {
877 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_schedule', $prefix, []);
60808919 878 return $r;
e501603b 879 }
c3fc2621 880
e501603b
TO
881 /**
882 * Returns the list of fields that can be exported
883 *
884 * @param bool $prefix
885 *
886 * @return array
887 */
c3fc2621
CW
888 public static function &export($prefix = FALSE) {
889 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_schedule', $prefix, []);
60808919 890 return $r;
e501603b 891 }
c3fc2621 892
e7a6b91a
AS
893 /**
894 * Returns the list of indices
c3fc2621
CW
895 *
896 * @param bool $localize
897 *
898 * @return array
e7a6b91a
AS
899 */
900 public static function indices($localize = TRUE) {
c3fc2621 901 $indices = [];
e7a6b91a
AS
902 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
903 }
c3fc2621 904
e501603b 905}