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