Merge pull request #9503 from agh1/same-match-honoree
[civicrm-core.git] / CRM / Core / DAO / ActionSchedule.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2017
30 *
31 * Generated from xml/schema/CRM/Core/ActionSchedule.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:06960967b276e6b2b7cd31a7ded61c03)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Core_DAO_ActionSchedule constructor.
39 */
40 class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_action_schedule';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 *
55 * @var int unsigned
56 */
57 public $id;
58 /**
59 * Name of the action(reminder)
60 *
61 * @var string
62 */
63 public $name;
64 /**
65 * Title of the action(reminder)
66 *
67 * @var string
68 */
69 public $title;
70 /**
71 * Recipient
72 *
73 * @var string
74 */
75 public $recipient;
76 /**
77 * Is this the recipient criteria limited to OR in addition to?
78 *
79 * @var boolean
80 */
81 public $limit_to;
82 /**
83 * Entity value
84 *
85 * @var string
86 */
87 public $entity_value;
88 /**
89 * Entity status
90 *
91 * @var string
92 */
93 public $entity_status;
94 /**
95 * Reminder Interval.
96 *
97 * @var int unsigned
98 */
99 public $start_action_offset;
100 /**
101 * Time units for reminder.
102 *
103 * @var string
104 */
105 public $start_action_unit;
106 /**
107 * Reminder Action
108 *
109 * @var string
110 */
111 public $start_action_condition;
112 /**
113 * Entity date
114 *
115 * @var string
116 */
117 public $start_action_date;
118 /**
119 *
120 * @var boolean
121 */
122 public $is_repeat;
123 /**
124 * Time units for repetition of reminder.
125 *
126 * @var string
127 */
128 public $repetition_frequency_unit;
129 /**
130 * Time interval for repeating the reminder.
131 *
132 * @var int unsigned
133 */
134 public $repetition_frequency_interval;
135 /**
136 * Time units till repetition of reminder.
137 *
138 * @var string
139 */
140 public $end_frequency_unit;
141 /**
142 * Time interval till repeating the reminder.
143 *
144 * @var int unsigned
145 */
146 public $end_frequency_interval;
147 /**
148 * Reminder Action till repeating the reminder.
149 *
150 * @var string
151 */
152 public $end_action;
153 /**
154 * Entity end date
155 *
156 * @var string
157 */
158 public $end_date;
159 /**
160 * Is this option active?
161 *
162 * @var boolean
163 */
164 public $is_active;
165 /**
166 * Contact IDs to which reminder should be sent.
167 *
168 * @var string
169 */
170 public $recipient_manual;
171 /**
172 * listing based on recipient field.
173 *
174 * @var string
175 */
176 public $recipient_listing;
177 /**
178 * Body of the mailing in text format.
179 *
180 * @var longtext
181 */
182 public $body_text;
183 /**
184 * Body of the mailing in html format.
185 *
186 * @var longtext
187 */
188 public $body_html;
189 /**
190 * Content of the SMS text.
191 *
192 * @var longtext
193 */
194 public $sms_body_text;
195 /**
196 * Subject of mailing
197 *
198 * @var string
199 */
200 public $subject;
201 /**
202 * Record Activity for this reminder?
203 *
204 * @var boolean
205 */
206 public $record_activity;
207 /**
208 * Name/ID of the mapping to use on this table
209 *
210 * @var string
211 */
212 public $mapping_id;
213 /**
214 * FK to Group
215 *
216 * @var int unsigned
217 */
218 public $group_id;
219 /**
220 * FK to the message template.
221 *
222 * @var int unsigned
223 */
224 public $msg_template_id;
225 /**
226 * FK to the message template.
227 *
228 * @var int unsigned
229 */
230 public $sms_template_id;
231 /**
232 * Date on which the reminder be sent.
233 *
234 * @var date
235 */
236 public $absolute_date;
237 /**
238 * Name in "from" field
239 *
240 * @var string
241 */
242 public $from_name;
243 /**
244 * Email address in "from" field
245 *
246 * @var string
247 */
248 public $from_email;
249 /**
250 * Send the message as email or sms or both.
251 *
252 * @var string
253 */
254 public $mode;
255 /**
256 *
257 * @var int unsigned
258 */
259 public $sms_provider_id;
260 /**
261 * Used for repeating entity
262 *
263 * @var string
264 */
265 public $used_for;
266 /**
267 * Used for multilingual installation
268 *
269 * @var string
270 */
271 public $filter_contact_language;
272 /**
273 * Used for multilingual installation
274 *
275 * @var string
276 */
277 public $communication_language;
278 /**
279 * Class constructor.
280 */
281 function __construct() {
282 $this->__table = 'civicrm_action_schedule';
283 parent::__construct();
284 }
285 /**
286 * Returns foreign keys and entity references.
287 *
288 * @return array
289 * [CRM_Core_Reference_Interface]
290 */
291 static function getReferenceColumns() {
292 if (!isset(Civi::$statics[__CLASS__]['links'])) {
293 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
294 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id');
295 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'msg_template_id', 'civicrm_msg_template', 'id');
296 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'sms_template_id', 'civicrm_msg_template', 'id');
297 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'sms_provider_id', 'civicrm_sms_provider', 'id');
298 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
299 }
300 return Civi::$statics[__CLASS__]['links'];
301 }
302 /**
303 * Returns all the column names of this table
304 *
305 * @return array
306 */
307 static function &fields() {
308 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
309 Civi::$statics[__CLASS__]['fields'] = array(
310 'id' => array(
311 'name' => 'id',
312 'type' => CRM_Utils_Type::T_INT,
313 'title' => ts('Action Schedule ID') ,
314 'required' => true,
315 ) ,
316 'name' => array(
317 'name' => 'name',
318 'type' => CRM_Utils_Type::T_STRING,
319 'title' => ts('Name') ,
320 'description' => 'Name of the action(reminder)',
321 'maxlength' => 64,
322 'size' => CRM_Utils_Type::BIG,
323 ) ,
324 'title' => array(
325 'name' => 'title',
326 'type' => CRM_Utils_Type::T_STRING,
327 'title' => ts('Title') ,
328 'description' => 'Title of the action(reminder)',
329 'maxlength' => 64,
330 'size' => CRM_Utils_Type::BIG,
331 ) ,
332 'recipient' => array(
333 'name' => 'recipient',
334 'type' => CRM_Utils_Type::T_STRING,
335 'title' => ts('Recipient') ,
336 'description' => 'Recipient',
337 'maxlength' => 64,
338 'size' => CRM_Utils_Type::BIG,
339 ) ,
340 'limit_to' => array(
341 'name' => 'limit_to',
342 'type' => CRM_Utils_Type::T_BOOLEAN,
343 'title' => ts('Limit To') ,
344 'description' => 'Is this the recipient criteria limited to OR in addition to?',
345 ) ,
346 'entity_value' => array(
347 'name' => 'entity_value',
348 'type' => CRM_Utils_Type::T_STRING,
349 'title' => ts('Entity Value') ,
350 'description' => 'Entity value',
351 'maxlength' => 255,
352 'size' => CRM_Utils_Type::HUGE,
353 ) ,
354 'entity_status' => array(
355 'name' => 'entity_status',
356 'type' => CRM_Utils_Type::T_STRING,
357 'title' => ts('Entity Status') ,
358 'description' => 'Entity status',
359 'maxlength' => 64,
360 'size' => CRM_Utils_Type::BIG,
361 ) ,
362 'start_action_offset' => array(
363 'name' => 'start_action_offset',
364 'type' => CRM_Utils_Type::T_INT,
365 'title' => ts('Start Action Offset') ,
366 'description' => 'Reminder Interval.',
367 ) ,
368 'start_action_unit' => array(
369 'name' => 'start_action_unit',
370 'type' => CRM_Utils_Type::T_STRING,
371 'title' => ts('Start Action Unit') ,
372 'description' => 'Time units for reminder.',
373 'maxlength' => 8,
374 'size' => CRM_Utils_Type::EIGHT,
375 'html' => array(
376 'type' => 'Select',
377 ) ,
378 'pseudoconstant' => array(
379 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
380 )
381 ) ,
382 'start_action_condition' => array(
383 'name' => 'start_action_condition',
384 'type' => CRM_Utils_Type::T_STRING,
385 'title' => ts('Start Action Condition') ,
386 'description' => 'Reminder Action',
387 'maxlength' => 64,
388 'size' => CRM_Utils_Type::BIG,
389 ) ,
390 'start_action_date' => array(
391 'name' => 'start_action_date',
392 'type' => CRM_Utils_Type::T_STRING,
393 'title' => ts('Start Action Date') ,
394 'description' => 'Entity date',
395 'maxlength' => 64,
396 'size' => CRM_Utils_Type::BIG,
397 ) ,
398 'is_repeat' => array(
399 'name' => 'is_repeat',
400 'type' => CRM_Utils_Type::T_BOOLEAN,
401 'title' => ts('Repeat?') ,
402 ) ,
403 'repetition_frequency_unit' => array(
404 'name' => 'repetition_frequency_unit',
405 'type' => CRM_Utils_Type::T_STRING,
406 'title' => ts('Repetition Frequency Unit') ,
407 'description' => 'Time units for repetition of reminder.',
408 'maxlength' => 8,
409 'size' => CRM_Utils_Type::EIGHT,
410 'html' => array(
411 'type' => 'Select',
412 ) ,
413 'pseudoconstant' => array(
414 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
415 )
416 ) ,
417 'repetition_frequency_interval' => array(
418 'name' => 'repetition_frequency_interval',
419 'type' => CRM_Utils_Type::T_INT,
420 'title' => ts('Repetition Frequency Interval') ,
421 'description' => 'Time interval for repeating the reminder.',
422 ) ,
423 'end_frequency_unit' => array(
424 'name' => 'end_frequency_unit',
425 'type' => CRM_Utils_Type::T_STRING,
426 'title' => ts('End Frequency Unit') ,
427 'description' => 'Time units till repetition of reminder.',
428 'maxlength' => 8,
429 'size' => CRM_Utils_Type::EIGHT,
430 'html' => array(
431 'type' => 'Select',
432 ) ,
433 'pseudoconstant' => array(
434 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
435 )
436 ) ,
437 'end_frequency_interval' => array(
438 'name' => 'end_frequency_interval',
439 'type' => CRM_Utils_Type::T_INT,
440 'title' => ts('End Frequency Interval') ,
441 'description' => 'Time interval till repeating the reminder.',
442 ) ,
443 'end_action' => array(
444 'name' => 'end_action',
445 'type' => CRM_Utils_Type::T_STRING,
446 'title' => ts('End Action') ,
447 'description' => 'Reminder Action till repeating the reminder.',
448 'maxlength' => 32,
449 'size' => CRM_Utils_Type::MEDIUM,
450 ) ,
451 'end_date' => array(
452 'name' => 'end_date',
453 'type' => CRM_Utils_Type::T_STRING,
454 'title' => ts('End Date') ,
455 'description' => 'Entity end date',
456 'maxlength' => 64,
457 'size' => CRM_Utils_Type::BIG,
458 ) ,
459 'is_active' => array(
460 'name' => 'is_active',
461 'type' => CRM_Utils_Type::T_BOOLEAN,
462 'title' => ts('Schedule is Active?') ,
463 'description' => 'Is this option active?',
464 'default' => '1',
465 ) ,
466 'recipient_manual' => array(
467 'name' => 'recipient_manual',
468 'type' => CRM_Utils_Type::T_STRING,
469 'title' => ts('Recipient Manual') ,
470 'description' => 'Contact IDs to which reminder should be sent.',
471 'maxlength' => 128,
472 'size' => CRM_Utils_Type::HUGE,
473 ) ,
474 'recipient_listing' => array(
475 'name' => 'recipient_listing',
476 'type' => CRM_Utils_Type::T_STRING,
477 'title' => ts('Recipient Listing') ,
478 'description' => 'listing based on recipient field.',
479 'maxlength' => 128,
480 'size' => CRM_Utils_Type::HUGE,
481 ) ,
482 'body_text' => array(
483 'name' => 'body_text',
484 'type' => CRM_Utils_Type::T_LONGTEXT,
485 'title' => ts('Reminder Text') ,
486 'description' => 'Body of the mailing in text format.',
487 ) ,
488 'body_html' => array(
489 'name' => 'body_html',
490 'type' => CRM_Utils_Type::T_LONGTEXT,
491 'title' => ts('Reminder HTML') ,
492 'description' => 'Body of the mailing in html format.',
493 ) ,
494 'sms_body_text' => array(
495 'name' => 'sms_body_text',
496 'type' => CRM_Utils_Type::T_LONGTEXT,
497 'title' => ts('SMS Reminder Text') ,
498 'description' => 'Content of the SMS text.',
499 ) ,
500 'subject' => array(
501 'name' => 'subject',
502 'type' => CRM_Utils_Type::T_STRING,
503 'title' => ts('Reminder Subject') ,
504 'description' => 'Subject of mailing',
505 'maxlength' => 128,
506 'size' => CRM_Utils_Type::HUGE,
507 ) ,
508 'record_activity' => array(
509 'name' => 'record_activity',
510 'type' => CRM_Utils_Type::T_BOOLEAN,
511 'title' => ts('Record Activity for Reminder?') ,
512 'description' => 'Record Activity for this reminder?',
513 'default' => 'NULL',
514 ) ,
515 'mapping_id' => array(
516 'name' => 'mapping_id',
517 'type' => CRM_Utils_Type::T_STRING,
518 'title' => ts('Reminder Mapping') ,
519 'description' => 'Name/ID of the mapping to use on this table',
520 'maxlength' => 64,
521 'size' => CRM_Utils_Type::BIG,
522 ) ,
523 'group_id' => array(
524 'name' => 'group_id',
525 'type' => CRM_Utils_Type::T_INT,
526 'title' => ts('Reminder Group') ,
527 'description' => 'FK to Group',
528 'FKClassName' => 'CRM_Contact_DAO_Group',
529 'html' => array(
530 'type' => 'Select',
531 ) ,
532 'pseudoconstant' => array(
533 'table' => 'civicrm_group',
534 'keyColumn' => 'id',
535 'labelColumn' => 'title',
536 )
537 ) ,
538 'msg_template_id' => array(
539 'name' => 'msg_template_id',
540 'type' => CRM_Utils_Type::T_INT,
541 'title' => ts('Reminder Template') ,
542 'description' => 'FK to the message template.',
543 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
544 ) ,
545 'sms_template_id' => array(
546 'name' => 'sms_template_id',
547 'type' => CRM_Utils_Type::T_INT,
548 'title' => ts('SMS Reminder Template') ,
549 'description' => 'FK to the message template.',
550 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
551 ) ,
552 'absolute_date' => array(
553 'name' => 'absolute_date',
554 'type' => CRM_Utils_Type::T_DATE,
555 'title' => ts('Fixed Date for Reminder') ,
556 'description' => 'Date on which the reminder be sent.',
557 ) ,
558 'from_name' => array(
559 'name' => 'from_name',
560 'type' => CRM_Utils_Type::T_STRING,
561 'title' => ts('Reminder from Name') ,
562 'description' => 'Name in "from" field',
563 'maxlength' => 255,
564 'size' => CRM_Utils_Type::HUGE,
565 ) ,
566 'from_email' => array(
567 'name' => 'from_email',
568 'type' => CRM_Utils_Type::T_STRING,
569 'title' => ts('Reminder From Email') ,
570 'description' => 'Email address in "from" field',
571 'maxlength' => 255,
572 'size' => CRM_Utils_Type::HUGE,
573 ) ,
574 'mode' => array(
575 'name' => 'mode',
576 'type' => CRM_Utils_Type::T_STRING,
577 'title' => ts('Message Mode') ,
578 'description' => 'Send the message as email or sms or both.',
579 'maxlength' => 128,
580 'size' => CRM_Utils_Type::HUGE,
581 'default' => 'Email',
582 'html' => array(
583 'type' => 'Select',
584 ) ,
585 'pseudoconstant' => array(
586 'optionGroupName' => 'msg_mode',
587 'optionEditPath' => 'civicrm/admin/options/msg_mode',
588 )
589 ) ,
590 'sms_provider_id' => array(
591 'name' => 'sms_provider_id',
592 'type' => CRM_Utils_Type::T_INT,
593 'title' => ts('SMS Provider') ,
594 'FKClassName' => 'CRM_SMS_DAO_Provider',
595 'html' => array(
596 'type' => 'Select',
597 ) ,
598 ) ,
599 'used_for' => array(
600 'name' => 'used_for',
601 'type' => CRM_Utils_Type::T_STRING,
602 'title' => ts('Used For') ,
603 'description' => 'Used for repeating entity',
604 'maxlength' => 64,
605 'size' => CRM_Utils_Type::BIG,
606 ) ,
607 'filter_contact_language' => array(
608 'name' => 'filter_contact_language',
609 'type' => CRM_Utils_Type::T_STRING,
610 'title' => ts('Filter Contact Language') ,
611 'description' => 'Used for multilingual installation',
612 'maxlength' => 128,
613 'size' => CRM_Utils_Type::HUGE,
614 ) ,
615 'communication_language' => array(
616 'name' => 'communication_language',
617 'type' => CRM_Utils_Type::T_STRING,
618 'title' => ts('Communication Language') ,
619 'description' => 'Used for multilingual installation',
620 'maxlength' => 8,
621 'size' => CRM_Utils_Type::EIGHT,
622 ) ,
623 );
624 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
625 }
626 return Civi::$statics[__CLASS__]['fields'];
627 }
628 /**
629 * Return a mapping from field-name to the corresponding key (as used in fields()).
630 *
631 * @return array
632 * Array(string $name => string $uniqueName).
633 */
634 static function &fieldKeys() {
635 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
636 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
637 }
638 return Civi::$statics[__CLASS__]['fieldKeys'];
639 }
640 /**
641 * Returns the names of this table
642 *
643 * @return string
644 */
645 static function getTableName() {
646 return self::$_tableName;
647 }
648 /**
649 * Returns if this table needs to be logged
650 *
651 * @return boolean
652 */
653 function getLog() {
654 return self::$_log;
655 }
656 /**
657 * Returns the list of fields that can be imported
658 *
659 * @param bool $prefix
660 *
661 * @return array
662 */
663 static function &import($prefix = false) {
664 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_schedule', $prefix, array());
665 return $r;
666 }
667 /**
668 * Returns the list of fields that can be exported
669 *
670 * @param bool $prefix
671 *
672 * @return array
673 */
674 static function &export($prefix = false) {
675 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_schedule', $prefix, array());
676 return $r;
677 }
678 }