Merge pull request #10549 from jitendrapurohit/CRM-20761
[civicrm-core.git] / CRM / Core / DAO / ActionSchedule.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
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
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Core/ActionSchedule.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
022785d8 33 * (GenCodeChecksum:d158b2da297ca83e4210a3fa0da8d5eb)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Core_DAO_ActionSchedule constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_action_schedule';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
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 /**
f41f0342 279 * Class constructor.
e501603b
TO
280 */
281 function __construct() {
282 $this->__table = 'civicrm_action_schedule';
283 parent::__construct();
284 }
285 /**
f41f0342 286 * Returns foreign keys and entity references.
e501603b
TO
287 *
288 * @return array
289 * [CRM_Core_Reference_Interface]
290 */
291 static function getReferenceColumns() {
346aaaba
TO
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']);
e501603b 299 }
346aaaba 300 return Civi::$statics[__CLASS__]['links'];
e501603b
TO
301 }
302 /**
303 * Returns all the column names of this table
304 *
305 * @return array
306 */
307 static function &fields() {
346aaaba
TO
308 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
309 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
310 'id' => array(
311 'name' => 'id',
312 'type' => CRM_Utils_Type::T_INT,
313 'title' => ts('Action Schedule ID') ,
314 'required' => true,
522a26c9 315 'table_name' => 'civicrm_action_schedule',
316 'entity' => 'ActionSchedule',
317 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 318 'localizable' => 0,
e501603b
TO
319 ) ,
320 'name' => array(
321 'name' => 'name',
322 'type' => CRM_Utils_Type::T_STRING,
323 'title' => ts('Name') ,
324 'description' => 'Name of the action(reminder)',
325 'maxlength' => 64,
326 'size' => CRM_Utils_Type::BIG,
522a26c9 327 'table_name' => 'civicrm_action_schedule',
328 'entity' => 'ActionSchedule',
329 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 330 'localizable' => 0,
e501603b
TO
331 ) ,
332 'title' => array(
333 'name' => 'title',
334 'type' => CRM_Utils_Type::T_STRING,
335 'title' => ts('Title') ,
336 'description' => 'Title of the action(reminder)',
337 'maxlength' => 64,
338 'size' => CRM_Utils_Type::BIG,
522a26c9 339 'table_name' => 'civicrm_action_schedule',
340 'entity' => 'ActionSchedule',
341 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 342 'localizable' => 0,
e501603b
TO
343 ) ,
344 'recipient' => array(
345 'name' => 'recipient',
346 'type' => CRM_Utils_Type::T_STRING,
347 'title' => ts('Recipient') ,
348 'description' => 'Recipient',
349 'maxlength' => 64,
350 'size' => CRM_Utils_Type::BIG,
522a26c9 351 'table_name' => 'civicrm_action_schedule',
352 'entity' => 'ActionSchedule',
353 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 354 'localizable' => 0,
e501603b
TO
355 ) ,
356 'limit_to' => array(
357 'name' => 'limit_to',
358 'type' => CRM_Utils_Type::T_BOOLEAN,
359 'title' => ts('Limit To') ,
360 'description' => 'Is this the recipient criteria limited to OR in addition to?',
522a26c9 361 'table_name' => 'civicrm_action_schedule',
362 'entity' => 'ActionSchedule',
363 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 364 'localizable' => 0,
e501603b
TO
365 ) ,
366 'entity_value' => array(
367 'name' => 'entity_value',
368 'type' => CRM_Utils_Type::T_STRING,
369 'title' => ts('Entity Value') ,
370 'description' => 'Entity value',
371 'maxlength' => 255,
372 'size' => CRM_Utils_Type::HUGE,
522a26c9 373 'table_name' => 'civicrm_action_schedule',
374 'entity' => 'ActionSchedule',
375 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 376 'localizable' => 0,
e501603b
TO
377 ) ,
378 'entity_status' => array(
379 'name' => 'entity_status',
380 'type' => CRM_Utils_Type::T_STRING,
381 'title' => ts('Entity Status') ,
382 'description' => 'Entity status',
383 'maxlength' => 64,
384 'size' => CRM_Utils_Type::BIG,
522a26c9 385 'table_name' => 'civicrm_action_schedule',
386 'entity' => 'ActionSchedule',
387 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 388 'localizable' => 0,
e501603b
TO
389 ) ,
390 'start_action_offset' => array(
391 'name' => 'start_action_offset',
392 'type' => CRM_Utils_Type::T_INT,
393 'title' => ts('Start Action Offset') ,
394 'description' => 'Reminder Interval.',
522a26c9 395 'table_name' => 'civicrm_action_schedule',
396 'entity' => 'ActionSchedule',
397 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 398 'localizable' => 0,
e501603b
TO
399 ) ,
400 'start_action_unit' => array(
401 'name' => 'start_action_unit',
402 'type' => CRM_Utils_Type::T_STRING,
403 'title' => ts('Start Action Unit') ,
404 'description' => 'Time units for reminder.',
405 'maxlength' => 8,
406 'size' => CRM_Utils_Type::EIGHT,
522a26c9 407 'table_name' => 'civicrm_action_schedule',
408 'entity' => 'ActionSchedule',
409 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 410 'localizable' => 0,
e501603b
TO
411 'html' => array(
412 'type' => 'Select',
413 ) ,
414 'pseudoconstant' => array(
415 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
416 )
417 ) ,
418 'start_action_condition' => array(
419 'name' => 'start_action_condition',
420 'type' => CRM_Utils_Type::T_STRING,
421 'title' => ts('Start Action Condition') ,
422 'description' => 'Reminder Action',
ed6e48d9 423 'maxlength' => 64,
424 'size' => CRM_Utils_Type::BIG,
522a26c9 425 'table_name' => 'civicrm_action_schedule',
426 'entity' => 'ActionSchedule',
427 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 428 'localizable' => 0,
e501603b
TO
429 ) ,
430 'start_action_date' => array(
431 'name' => 'start_action_date',
432 'type' => CRM_Utils_Type::T_STRING,
433 'title' => ts('Start Action Date') ,
434 'description' => 'Entity date',
435 'maxlength' => 64,
436 'size' => CRM_Utils_Type::BIG,
522a26c9 437 'table_name' => 'civicrm_action_schedule',
438 'entity' => 'ActionSchedule',
439 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 440 'localizable' => 0,
e501603b
TO
441 ) ,
442 'is_repeat' => array(
443 'name' => 'is_repeat',
444 'type' => CRM_Utils_Type::T_BOOLEAN,
445 'title' => ts('Repeat?') ,
522a26c9 446 'table_name' => 'civicrm_action_schedule',
447 'entity' => 'ActionSchedule',
448 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 449 'localizable' => 0,
e501603b
TO
450 ) ,
451 'repetition_frequency_unit' => array(
452 'name' => 'repetition_frequency_unit',
453 'type' => CRM_Utils_Type::T_STRING,
454 'title' => ts('Repetition Frequency Unit') ,
455 'description' => 'Time units for repetition of reminder.',
456 'maxlength' => 8,
457 'size' => CRM_Utils_Type::EIGHT,
522a26c9 458 'table_name' => 'civicrm_action_schedule',
459 'entity' => 'ActionSchedule',
460 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 461 'localizable' => 0,
e501603b
TO
462 'html' => array(
463 'type' => 'Select',
464 ) ,
465 'pseudoconstant' => array(
466 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
467 )
468 ) ,
469 'repetition_frequency_interval' => array(
470 'name' => 'repetition_frequency_interval',
471 'type' => CRM_Utils_Type::T_INT,
472 'title' => ts('Repetition Frequency Interval') ,
473 'description' => 'Time interval for repeating the reminder.',
522a26c9 474 'table_name' => 'civicrm_action_schedule',
475 'entity' => 'ActionSchedule',
476 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 477 'localizable' => 0,
e501603b
TO
478 ) ,
479 'end_frequency_unit' => array(
480 'name' => 'end_frequency_unit',
481 'type' => CRM_Utils_Type::T_STRING,
482 'title' => ts('End Frequency Unit') ,
483 'description' => 'Time units till repetition of reminder.',
484 'maxlength' => 8,
485 'size' => CRM_Utils_Type::EIGHT,
522a26c9 486 'table_name' => 'civicrm_action_schedule',
487 'entity' => 'ActionSchedule',
488 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 489 'localizable' => 0,
e501603b
TO
490 'html' => array(
491 'type' => 'Select',
492 ) ,
493 'pseudoconstant' => array(
494 'callback' => 'CRM_Core_SelectValues::getRecurringFrequencyUnits',
495 )
496 ) ,
497 'end_frequency_interval' => array(
498 'name' => 'end_frequency_interval',
499 'type' => CRM_Utils_Type::T_INT,
500 'title' => ts('End Frequency Interval') ,
501 'description' => 'Time interval till repeating the reminder.',
522a26c9 502 'table_name' => 'civicrm_action_schedule',
503 'entity' => 'ActionSchedule',
504 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 505 'localizable' => 0,
e501603b
TO
506 ) ,
507 'end_action' => array(
508 'name' => 'end_action',
509 'type' => CRM_Utils_Type::T_STRING,
510 'title' => ts('End Action') ,
511 'description' => 'Reminder Action till repeating the reminder.',
512 'maxlength' => 32,
513 'size' => CRM_Utils_Type::MEDIUM,
522a26c9 514 'table_name' => 'civicrm_action_schedule',
515 'entity' => 'ActionSchedule',
516 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 517 'localizable' => 0,
e501603b
TO
518 ) ,
519 'end_date' => array(
520 'name' => 'end_date',
521 'type' => CRM_Utils_Type::T_STRING,
522 'title' => ts('End Date') ,
523 'description' => 'Entity end date',
524 'maxlength' => 64,
525 'size' => CRM_Utils_Type::BIG,
522a26c9 526 'table_name' => 'civicrm_action_schedule',
527 'entity' => 'ActionSchedule',
528 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 529 'localizable' => 0,
e501603b
TO
530 ) ,
531 'is_active' => array(
532 'name' => 'is_active',
533 'type' => CRM_Utils_Type::T_BOOLEAN,
534 'title' => ts('Schedule is Active?') ,
535 'description' => 'Is this option active?',
536 'default' => '1',
522a26c9 537 'table_name' => 'civicrm_action_schedule',
538 'entity' => 'ActionSchedule',
539 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 540 'localizable' => 0,
e501603b
TO
541 ) ,
542 'recipient_manual' => array(
543 'name' => 'recipient_manual',
544 'type' => CRM_Utils_Type::T_STRING,
545 'title' => ts('Recipient Manual') ,
546 'description' => 'Contact IDs to which reminder should be sent.',
547 'maxlength' => 128,
548 'size' => CRM_Utils_Type::HUGE,
522a26c9 549 'table_name' => 'civicrm_action_schedule',
550 'entity' => 'ActionSchedule',
551 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 552 'localizable' => 0,
e501603b
TO
553 ) ,
554 'recipient_listing' => array(
555 'name' => 'recipient_listing',
556 'type' => CRM_Utils_Type::T_STRING,
557 'title' => ts('Recipient Listing') ,
558 'description' => 'listing based on recipient field.',
559 'maxlength' => 128,
560 'size' => CRM_Utils_Type::HUGE,
522a26c9 561 'table_name' => 'civicrm_action_schedule',
562 'entity' => 'ActionSchedule',
563 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 564 'localizable' => 0,
e501603b
TO
565 ) ,
566 'body_text' => array(
567 'name' => 'body_text',
568 'type' => CRM_Utils_Type::T_LONGTEXT,
569 'title' => ts('Reminder Text') ,
570 'description' => 'Body of the mailing in text format.',
522a26c9 571 'table_name' => 'civicrm_action_schedule',
572 'entity' => 'ActionSchedule',
573 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 574 'localizable' => 0,
e501603b
TO
575 ) ,
576 'body_html' => array(
577 'name' => 'body_html',
578 'type' => CRM_Utils_Type::T_LONGTEXT,
579 'title' => ts('Reminder HTML') ,
580 'description' => 'Body of the mailing in html format.',
522a26c9 581 'table_name' => 'civicrm_action_schedule',
582 'entity' => 'ActionSchedule',
583 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 584 'localizable' => 0,
e501603b
TO
585 ) ,
586 'sms_body_text' => array(
587 'name' => 'sms_body_text',
588 'type' => CRM_Utils_Type::T_LONGTEXT,
589 'title' => ts('SMS Reminder Text') ,
590 'description' => 'Content of the SMS text.',
522a26c9 591 'table_name' => 'civicrm_action_schedule',
592 'entity' => 'ActionSchedule',
593 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 594 'localizable' => 0,
e501603b
TO
595 ) ,
596 'subject' => array(
597 'name' => 'subject',
598 'type' => CRM_Utils_Type::T_STRING,
599 'title' => ts('Reminder Subject') ,
600 'description' => 'Subject of mailing',
601 'maxlength' => 128,
602 'size' => CRM_Utils_Type::HUGE,
522a26c9 603 'table_name' => 'civicrm_action_schedule',
604 'entity' => 'ActionSchedule',
605 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 606 'localizable' => 0,
e501603b
TO
607 ) ,
608 'record_activity' => array(
609 'name' => 'record_activity',
610 'type' => CRM_Utils_Type::T_BOOLEAN,
611 'title' => ts('Record Activity for Reminder?') ,
612 'description' => 'Record Activity for this reminder?',
613 'default' => 'NULL',
522a26c9 614 'table_name' => 'civicrm_action_schedule',
615 'entity' => 'ActionSchedule',
616 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 617 'localizable' => 0,
e501603b
TO
618 ) ,
619 'mapping_id' => array(
620 'name' => 'mapping_id',
621 'type' => CRM_Utils_Type::T_STRING,
622 'title' => ts('Reminder Mapping') ,
623 'description' => 'Name/ID of the mapping to use on this table',
624 'maxlength' => 64,
625 'size' => CRM_Utils_Type::BIG,
522a26c9 626 'table_name' => 'civicrm_action_schedule',
627 'entity' => 'ActionSchedule',
628 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 629 'localizable' => 0,
e501603b
TO
630 ) ,
631 'group_id' => array(
632 'name' => 'group_id',
633 'type' => CRM_Utils_Type::T_INT,
634 'title' => ts('Reminder Group') ,
635 'description' => 'FK to Group',
522a26c9 636 'table_name' => 'civicrm_action_schedule',
637 'entity' => 'ActionSchedule',
638 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 639 'localizable' => 0,
e501603b
TO
640 'FKClassName' => 'CRM_Contact_DAO_Group',
641 'html' => array(
642 'type' => 'Select',
643 ) ,
644 'pseudoconstant' => array(
645 'table' => 'civicrm_group',
646 'keyColumn' => 'id',
647 'labelColumn' => 'title',
648 )
649 ) ,
650 'msg_template_id' => array(
651 'name' => 'msg_template_id',
652 'type' => CRM_Utils_Type::T_INT,
653 'title' => ts('Reminder Template') ,
654 'description' => 'FK to the message template.',
522a26c9 655 'table_name' => 'civicrm_action_schedule',
656 'entity' => 'ActionSchedule',
657 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 658 'localizable' => 0,
e501603b
TO
659 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
660 ) ,
661 'sms_template_id' => array(
662 'name' => 'sms_template_id',
663 'type' => CRM_Utils_Type::T_INT,
664 'title' => ts('SMS Reminder Template') ,
665 'description' => 'FK to the message template.',
522a26c9 666 'table_name' => 'civicrm_action_schedule',
667 'entity' => 'ActionSchedule',
668 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 669 'localizable' => 0,
e501603b
TO
670 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
671 ) ,
672 'absolute_date' => array(
673 'name' => 'absolute_date',
674 'type' => CRM_Utils_Type::T_DATE,
675 'title' => ts('Fixed Date for Reminder') ,
676 'description' => 'Date on which the reminder be sent.',
522a26c9 677 'table_name' => 'civicrm_action_schedule',
678 'entity' => 'ActionSchedule',
679 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 680 'localizable' => 0,
e501603b
TO
681 ) ,
682 'from_name' => array(
683 'name' => 'from_name',
684 'type' => CRM_Utils_Type::T_STRING,
685 'title' => ts('Reminder from Name') ,
686 'description' => 'Name in "from" field',
687 'maxlength' => 255,
688 'size' => CRM_Utils_Type::HUGE,
522a26c9 689 'table_name' => 'civicrm_action_schedule',
690 'entity' => 'ActionSchedule',
691 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 692 'localizable' => 0,
e501603b
TO
693 ) ,
694 'from_email' => array(
695 'name' => 'from_email',
696 'type' => CRM_Utils_Type::T_STRING,
697 'title' => ts('Reminder From Email') ,
698 'description' => 'Email address in "from" field',
699 'maxlength' => 255,
700 'size' => CRM_Utils_Type::HUGE,
522a26c9 701 'table_name' => 'civicrm_action_schedule',
702 'entity' => 'ActionSchedule',
703 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 704 'localizable' => 0,
e501603b
TO
705 ) ,
706 'mode' => array(
707 'name' => 'mode',
708 'type' => CRM_Utils_Type::T_STRING,
709 'title' => ts('Message Mode') ,
710 'description' => 'Send the message as email or sms or both.',
711 'maxlength' => 128,
712 'size' => CRM_Utils_Type::HUGE,
713 'default' => 'Email',
522a26c9 714 'table_name' => 'civicrm_action_schedule',
715 'entity' => 'ActionSchedule',
716 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 717 'localizable' => 0,
e501603b
TO
718 'html' => array(
719 'type' => 'Select',
720 ) ,
721 'pseudoconstant' => array(
722 'optionGroupName' => 'msg_mode',
723 'optionEditPath' => 'civicrm/admin/options/msg_mode',
724 )
725 ) ,
726 'sms_provider_id' => array(
727 'name' => 'sms_provider_id',
728 'type' => CRM_Utils_Type::T_INT,
729 'title' => ts('SMS Provider') ,
522a26c9 730 'table_name' => 'civicrm_action_schedule',
731 'entity' => 'ActionSchedule',
732 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 733 'localizable' => 0,
e501603b
TO
734 'FKClassName' => 'CRM_SMS_DAO_Provider',
735 'html' => array(
736 'type' => 'Select',
737 ) ,
738 ) ,
739 'used_for' => array(
740 'name' => 'used_for',
741 'type' => CRM_Utils_Type::T_STRING,
742 'title' => ts('Used For') ,
743 'description' => 'Used for repeating entity',
744 'maxlength' => 64,
745 'size' => CRM_Utils_Type::BIG,
522a26c9 746 'table_name' => 'civicrm_action_schedule',
747 'entity' => 'ActionSchedule',
748 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 749 'localizable' => 0,
e501603b
TO
750 ) ,
751 'filter_contact_language' => array(
752 'name' => 'filter_contact_language',
753 'type' => CRM_Utils_Type::T_STRING,
754 'title' => ts('Filter Contact Language') ,
755 'description' => 'Used for multilingual installation',
756 'maxlength' => 128,
757 'size' => CRM_Utils_Type::HUGE,
522a26c9 758 'table_name' => 'civicrm_action_schedule',
759 'entity' => 'ActionSchedule',
760 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 761 'localizable' => 0,
e501603b
TO
762 ) ,
763 'communication_language' => array(
764 'name' => 'communication_language',
765 'type' => CRM_Utils_Type::T_STRING,
766 'title' => ts('Communication Language') ,
767 'description' => 'Used for multilingual installation',
768 'maxlength' => 8,
769 'size' => CRM_Utils_Type::EIGHT,
522a26c9 770 'table_name' => 'civicrm_action_schedule',
771 'entity' => 'ActionSchedule',
772 'bao' => 'CRM_Core_BAO_ActionSchedule',
6a7e5e5d 773 'localizable' => 0,
e501603b
TO
774 ) ,
775 );
346aaaba 776 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 777 }
346aaaba 778 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
779 }
780 /**
bd8e0b14 781 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
782 *
783 * @return array
bd8e0b14 784 * Array(string $name => string $uniqueName).
e501603b
TO
785 */
786 static function &fieldKeys() {
bd8e0b14
TO
787 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
788 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 789 }
bd8e0b14 790 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
791 }
792 /**
793 * Returns the names of this table
794 *
795 * @return string
796 */
797 static function getTableName() {
798 return self::$_tableName;
799 }
800 /**
801 * Returns if this table needs to be logged
802 *
803 * @return boolean
804 */
805 function getLog() {
806 return self::$_log;
807 }
808 /**
809 * Returns the list of fields that can be imported
810 *
811 * @param bool $prefix
812 *
813 * @return array
814 */
815 static function &import($prefix = false) {
60808919
TO
816 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'action_schedule', $prefix, array());
817 return $r;
e501603b
TO
818 }
819 /**
820 * Returns the list of fields that can be exported
821 *
822 * @param bool $prefix
823 *
824 * @return array
825 */
826 static function &export($prefix = false) {
60808919
TO
827 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'action_schedule', $prefix, array());
828 return $r;
e501603b 829 }
e7a6b91a
AS
830 /**
831 * Returns the list of indices
832 */
833 public static function indices($localize = TRUE) {
834 $indices = array();
835 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
836 }
e501603b 837}