3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Mailing/Mailing.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:3711bcf18e92336fdc0a4c81af169de6)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Mailing_DAO_Mailing constructor.
40 class CRM_Mailing_DAO_Mailing
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_mailing';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
59 * Which site is this mailing for
65 * FK to the header component.
71 * FK to the footer component.
77 * FK to the auto-responder component.
83 * FK to the unsubscribe component.
87 public $unsubscribe_id;
92 public $resubscribe_id;
94 * FK to the opt-out component.
106 * differentiate between standalone mailings, A/B tests, and A/B final-winner
110 public $mailing_type;
112 * From Header of mailing
118 * From Email of mailing
124 * Reply-To Email of mailing
128 public $replyto_email;
130 * The language/processing system used for email templates.
134 public $template_type;
136 * Advanced options used by the email templating system. (JSON encoded)
140 public $template_options;
148 * Body of the mailing in text format.
154 * Body of the mailing in html format.
160 * Should we track URL click-throughs for this mailing?
164 public $url_tracking;
166 * Should we forward replies back to the author?
170 public $forward_replies;
172 * Should we enable the auto-responder?
176 public $auto_responder;
178 * Should we track when recipients open/read this mailing?
182 public $open_tracking;
184 * Has at least one job associated with this mailing finished?
188 public $is_completed;
190 * FK to the message template.
194 public $msg_template_id;
196 * Should we overrite VERP address in Reply-To
200 public $override_verp;
202 * FK to Contact ID who first created this mailing
208 * Date and time this mailing was created.
212 public $created_date;
214 * FK to Contact ID who scheduled this mailing
218 public $scheduled_id;
220 * Date and time this mailing was scheduled.
224 public $scheduled_date;
226 * FK to Contact ID who approved this mailing
232 * Date and time this mailing was approved.
236 public $approval_date;
238 * The status of this mailing. Values: none, approved, rejected
242 public $approval_status_id;
244 * Note behind the decision.
248 public $approval_note;
250 * Is this mailing archived?
256 * In what context(s) is the mailing contents visible (online viewing)
262 * The campaign for which this mailing has been initiated.
268 * Remove duplicate emails?
272 public $dedupe_email;
277 public $sms_provider_id;
279 * Key for validating requests related to this mailing.
285 * With email_selection_method, determines which email address to use
289 public $location_type_id;
291 * With location_type_id, determine how to choose the email address to use.
295 public $email_selection_method;
297 * Language of the content of the mailing. Useful for tokens.
305 function __construct() {
306 $this->__table
= 'civicrm_mailing';
307 parent
::__construct();
310 * Returns foreign keys and entity references.
313 * [CRM_Core_Reference_Interface]
315 static function getReferenceColumns() {
316 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
317 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
318 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
319 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'header_id', 'civicrm_mailing_component', 'id');
320 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'footer_id', 'civicrm_mailing_component', 'id');
321 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'reply_id', 'civicrm_mailing_component', 'id');
322 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'unsubscribe_id', 'civicrm_mailing_component', 'id');
323 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'optout_id', 'civicrm_mailing_component', 'id');
324 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'msg_template_id', 'civicrm_msg_template', 'id');
325 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
326 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'scheduled_id', 'civicrm_contact', 'id');
327 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'approver_id', 'civicrm_contact', 'id');
328 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
329 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'sms_provider_id', 'civicrm_sms_provider', 'id');
330 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'location_type_id', 'civicrm_location_type', 'id');
331 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
333 return Civi
::$statics[__CLASS__
]['links'];
336 * Returns all the column names of this table
340 static function &fields() {
341 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
342 Civi
::$statics[__CLASS__
]['fields'] = array(
345 'type' => CRM_Utils_Type
::T_INT
,
346 'title' => ts('Mailing ID') ,
348 'table_name' => 'civicrm_mailing',
349 'entity' => 'Mailing',
350 'bao' => 'CRM_Mailing_BAO_Mailing',
352 'domain_id' => array(
353 'name' => 'domain_id',
354 'type' => CRM_Utils_Type
::T_INT
,
355 'title' => ts('Mailing Domain') ,
356 'description' => 'Which site is this mailing for',
357 'table_name' => 'civicrm_mailing',
358 'entity' => 'Mailing',
359 'bao' => 'CRM_Mailing_BAO_Mailing',
360 'FKClassName' => 'CRM_Core_DAO_Domain',
361 'pseudoconstant' => array(
362 'table' => 'civicrm_domain',
364 'labelColumn' => 'name',
367 'header_id' => array(
368 'name' => 'header_id',
369 'type' => CRM_Utils_Type
::T_INT
,
370 'title' => ts('Mailing Header') ,
371 'description' => 'FK to the header component.',
372 'table_name' => 'civicrm_mailing',
373 'entity' => 'Mailing',
374 'bao' => 'CRM_Mailing_BAO_Mailing',
375 'FKClassName' => 'CRM_Mailing_DAO_Component',
377 'footer_id' => array(
378 'name' => 'footer_id',
379 'type' => CRM_Utils_Type
::T_INT
,
380 'title' => ts('Mailing Footer') ,
381 'description' => 'FK to the footer component.',
382 'table_name' => 'civicrm_mailing',
383 'entity' => 'Mailing',
384 'bao' => 'CRM_Mailing_BAO_Mailing',
385 'FKClassName' => 'CRM_Mailing_DAO_Component',
388 'name' => 'reply_id',
389 'type' => CRM_Utils_Type
::T_INT
,
390 'title' => ts('Mailing Reply') ,
391 'description' => 'FK to the auto-responder component.',
392 'table_name' => 'civicrm_mailing',
393 'entity' => 'Mailing',
394 'bao' => 'CRM_Mailing_BAO_Mailing',
395 'FKClassName' => 'CRM_Mailing_DAO_Component',
397 'unsubscribe_id' => array(
398 'name' => 'unsubscribe_id',
399 'type' => CRM_Utils_Type
::T_INT
,
400 'title' => ts('Mailing Unsubscribe') ,
401 'description' => 'FK to the unsubscribe component.',
402 'table_name' => 'civicrm_mailing',
403 'entity' => 'Mailing',
404 'bao' => 'CRM_Mailing_BAO_Mailing',
405 'FKClassName' => 'CRM_Mailing_DAO_Component',
407 'resubscribe_id' => array(
408 'name' => 'resubscribe_id',
409 'type' => CRM_Utils_Type
::T_INT
,
410 'title' => ts('Mailing Resubscribe') ,
411 'table_name' => 'civicrm_mailing',
412 'entity' => 'Mailing',
413 'bao' => 'CRM_Mailing_BAO_Mailing',
415 'optout_id' => array(
416 'name' => 'optout_id',
417 'type' => CRM_Utils_Type
::T_INT
,
418 'title' => ts('Mailing Opt Out') ,
419 'description' => 'FK to the opt-out component.',
420 'table_name' => 'civicrm_mailing',
421 'entity' => 'Mailing',
422 'bao' => 'CRM_Mailing_BAO_Mailing',
423 'FKClassName' => 'CRM_Mailing_DAO_Component',
427 'type' => CRM_Utils_Type
::T_STRING
,
428 'title' => ts('Mailing Name') ,
429 'description' => 'Mailing Name.',
431 'size' => CRM_Utils_Type
::HUGE
,
432 'table_name' => 'civicrm_mailing',
433 'entity' => 'Mailing',
434 'bao' => 'CRM_Mailing_BAO_Mailing',
439 'mailing_type' => array(
440 'name' => 'mailing_type',
441 'type' => CRM_Utils_Type
::T_STRING
,
442 'title' => ts('Mailing Type') ,
443 'description' => 'differentiate between standalone mailings, A/B tests, and A/B final-winner',
445 'size' => CRM_Utils_Type
::MEDIUM
,
446 'table_name' => 'civicrm_mailing',
447 'entity' => 'Mailing',
448 'bao' => 'CRM_Mailing_BAO_Mailing',
452 'pseudoconstant' => array(
453 'callback' => 'CRM_Mailing_PseudoConstant::mailingTypes',
456 'from_name' => array(
457 'name' => 'from_name',
458 'type' => CRM_Utils_Type
::T_STRING
,
459 'title' => ts('Mailing From Name') ,
460 'description' => 'From Header of mailing',
462 'size' => CRM_Utils_Type
::HUGE
,
463 'table_name' => 'civicrm_mailing',
464 'entity' => 'Mailing',
465 'bao' => 'CRM_Mailing_BAO_Mailing',
470 'from_email' => array(
471 'name' => 'from_email',
472 'type' => CRM_Utils_Type
::T_STRING
,
473 'title' => ts('Mailing From Email') ,
474 'description' => 'From Email of mailing',
476 'size' => CRM_Utils_Type
::HUGE
,
477 'table_name' => 'civicrm_mailing',
478 'entity' => 'Mailing',
479 'bao' => 'CRM_Mailing_BAO_Mailing',
484 'replyto_email' => array(
485 'name' => 'replyto_email',
486 'type' => CRM_Utils_Type
::T_STRING
,
487 'title' => ts('Replyto Email') ,
488 'description' => 'Reply-To Email of mailing',
490 'size' => CRM_Utils_Type
::HUGE
,
491 'table_name' => 'civicrm_mailing',
492 'entity' => 'Mailing',
493 'bao' => 'CRM_Mailing_BAO_Mailing',
498 'template_type' => array(
499 'name' => 'template_type',
500 'type' => CRM_Utils_Type
::T_STRING
,
501 'title' => ts('Template Type') ,
502 'description' => 'The language/processing system used for email templates.',
505 'size' => CRM_Utils_Type
::BIG
,
506 'default' => 'traditional',
507 'table_name' => 'civicrm_mailing',
508 'entity' => 'Mailing',
509 'bao' => 'CRM_Mailing_BAO_Mailing',
510 'pseudoconstant' => array(
511 'callback' => 'CRM_Mailing_BAO_Mailing::getTemplateTypeNames',
514 'template_options' => array(
515 'name' => 'template_options',
516 'type' => CRM_Utils_Type
::T_LONGTEXT
,
517 'title' => ts('Template Options (JSON)') ,
518 'description' => 'Advanced options used by the email templating system. (JSON encoded)',
519 'table_name' => 'civicrm_mailing',
520 'entity' => 'Mailing',
521 'bao' => 'CRM_Mailing_BAO_Mailing',
525 'type' => CRM_Utils_Type
::T_STRING
,
526 'title' => ts('Subject') ,
527 'description' => 'Subject of mailing',
529 'size' => CRM_Utils_Type
::HUGE
,
530 'table_name' => 'civicrm_mailing',
531 'entity' => 'Mailing',
532 'bao' => 'CRM_Mailing_BAO_Mailing',
537 'body_text' => array(
538 'name' => 'body_text',
539 'type' => CRM_Utils_Type
::T_LONGTEXT
,
540 'title' => ts('Body Text') ,
541 'description' => 'Body of the mailing in text format.',
542 'table_name' => 'civicrm_mailing',
543 'entity' => 'Mailing',
544 'bao' => 'CRM_Mailing_BAO_Mailing',
546 'body_html' => array(
547 'name' => 'body_html',
548 'type' => CRM_Utils_Type
::T_LONGTEXT
,
549 'title' => ts('Body Html') ,
550 'description' => 'Body of the mailing in html format.',
551 'table_name' => 'civicrm_mailing',
552 'entity' => 'Mailing',
553 'bao' => 'CRM_Mailing_BAO_Mailing',
555 'url_tracking' => array(
556 'name' => 'url_tracking',
557 'type' => CRM_Utils_Type
::T_BOOLEAN
,
558 'title' => ts('Url Tracking') ,
559 'description' => 'Should we track URL click-throughs for this mailing?',
560 'table_name' => 'civicrm_mailing',
561 'entity' => 'Mailing',
562 'bao' => 'CRM_Mailing_BAO_Mailing',
564 'type' => 'CheckBox',
567 'forward_replies' => array(
568 'name' => 'forward_replies',
569 'type' => CRM_Utils_Type
::T_BOOLEAN
,
570 'title' => ts('Forward Replies') ,
571 'description' => 'Should we forward replies back to the author?',
572 'table_name' => 'civicrm_mailing',
573 'entity' => 'Mailing',
574 'bao' => 'CRM_Mailing_BAO_Mailing',
576 'type' => 'CheckBox',
579 'auto_responder' => array(
580 'name' => 'auto_responder',
581 'type' => CRM_Utils_Type
::T_BOOLEAN
,
582 'title' => ts('Auto Responder') ,
583 'description' => 'Should we enable the auto-responder?',
584 'table_name' => 'civicrm_mailing',
585 'entity' => 'Mailing',
586 'bao' => 'CRM_Mailing_BAO_Mailing',
588 'type' => 'CheckBox',
591 'open_tracking' => array(
592 'name' => 'open_tracking',
593 'type' => CRM_Utils_Type
::T_BOOLEAN
,
594 'title' => ts('Track Mailing?') ,
595 'description' => 'Should we track when recipients open/read this mailing?',
596 'table_name' => 'civicrm_mailing',
597 'entity' => 'Mailing',
598 'bao' => 'CRM_Mailing_BAO_Mailing',
600 'is_completed' => array(
601 'name' => 'is_completed',
602 'type' => CRM_Utils_Type
::T_BOOLEAN
,
603 'title' => ts('Mailing Completed') ,
604 'description' => 'Has at least one job associated with this mailing finished?',
605 'table_name' => 'civicrm_mailing',
606 'entity' => 'Mailing',
607 'bao' => 'CRM_Mailing_BAO_Mailing',
609 'type' => 'CheckBox',
612 'msg_template_id' => array(
613 'name' => 'msg_template_id',
614 'type' => CRM_Utils_Type
::T_INT
,
615 'title' => ts('Mailing Message Template') ,
616 'description' => 'FK to the message template.',
617 'table_name' => 'civicrm_mailing',
618 'entity' => 'Mailing',
619 'bao' => 'CRM_Mailing_BAO_Mailing',
620 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
622 'override_verp' => array(
623 'name' => 'override_verp',
624 'type' => CRM_Utils_Type
::T_BOOLEAN
,
625 'title' => ts('Override Verp') ,
626 'description' => 'Should we overrite VERP address in Reply-To',
627 'table_name' => 'civicrm_mailing',
628 'entity' => 'Mailing',
629 'bao' => 'CRM_Mailing_BAO_Mailing',
631 'type' => 'CheckBox',
634 'created_id' => array(
635 'name' => 'created_id',
636 'type' => CRM_Utils_Type
::T_INT
,
637 'title' => ts('Mailing Creator') ,
638 'description' => 'FK to Contact ID who first created this mailing',
639 'table_name' => 'civicrm_mailing',
640 'entity' => 'Mailing',
641 'bao' => 'CRM_Mailing_BAO_Mailing',
642 'FKClassName' => 'CRM_Contact_DAO_Contact',
644 'created_date' => array(
645 'name' => 'created_date',
646 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
647 'title' => ts('Mailing Created Date') ,
648 'description' => 'Date and time this mailing was created.',
649 'table_name' => 'civicrm_mailing',
650 'entity' => 'Mailing',
651 'bao' => 'CRM_Mailing_BAO_Mailing',
653 'type' => 'Select Date',
656 'scheduled_id' => array(
657 'name' => 'scheduled_id',
658 'type' => CRM_Utils_Type
::T_INT
,
659 'title' => ts('Scheduled By') ,
660 'description' => 'FK to Contact ID who scheduled this mailing',
661 'table_name' => 'civicrm_mailing',
662 'entity' => 'Mailing',
663 'bao' => 'CRM_Mailing_BAO_Mailing',
664 'FKClassName' => 'CRM_Contact_DAO_Contact',
666 'scheduled_date' => array(
667 'name' => 'scheduled_date',
668 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
669 'title' => ts('Mailing Scheduled Date') ,
670 'description' => 'Date and time this mailing was scheduled.',
671 'table_name' => 'civicrm_mailing',
672 'entity' => 'Mailing',
673 'bao' => 'CRM_Mailing_BAO_Mailing',
675 'approver_id' => array(
676 'name' => 'approver_id',
677 'type' => CRM_Utils_Type
::T_INT
,
678 'title' => ts('Approved By') ,
679 'description' => 'FK to Contact ID who approved this mailing',
680 'table_name' => 'civicrm_mailing',
681 'entity' => 'Mailing',
682 'bao' => 'CRM_Mailing_BAO_Mailing',
683 'FKClassName' => 'CRM_Contact_DAO_Contact',
685 'approval_date' => array(
686 'name' => 'approval_date',
687 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
688 'title' => ts('Mailing Approved Date') ,
689 'description' => 'Date and time this mailing was approved.',
690 'table_name' => 'civicrm_mailing',
691 'entity' => 'Mailing',
692 'bao' => 'CRM_Mailing_BAO_Mailing',
694 'approval_status_id' => array(
695 'name' => 'approval_status_id',
696 'type' => CRM_Utils_Type
::T_INT
,
697 'title' => ts('Approval Status') ,
698 'description' => 'The status of this mailing. Values: none, approved, rejected',
699 'table_name' => 'civicrm_mailing',
700 'entity' => 'Mailing',
701 'bao' => 'CRM_Mailing_BAO_Mailing',
705 'pseudoconstant' => array(
706 'optionGroupName' => 'mail_approval_status',
707 'optionEditPath' => 'civicrm/admin/options/mail_approval_status',
710 'approval_note' => array(
711 'name' => 'approval_note',
712 'type' => CRM_Utils_Type
::T_LONGTEXT
,
713 'title' => ts('Approval Note') ,
714 'description' => 'Note behind the decision.',
715 'table_name' => 'civicrm_mailing',
716 'entity' => 'Mailing',
717 'bao' => 'CRM_Mailing_BAO_Mailing',
719 'type' => 'TextArea',
722 'is_archived' => array(
723 'name' => 'is_archived',
724 'type' => CRM_Utils_Type
::T_BOOLEAN
,
725 'title' => ts('Is Mailing Archived?') ,
726 'description' => 'Is this mailing archived?',
727 'table_name' => 'civicrm_mailing',
728 'entity' => 'Mailing',
729 'bao' => 'CRM_Mailing_BAO_Mailing',
731 'type' => 'CheckBox',
734 'visibility' => array(
735 'name' => 'visibility',
736 'type' => CRM_Utils_Type
::T_STRING
,
737 'title' => ts('Mailing Visibility') ,
738 'description' => 'In what context(s) is the mailing contents visible (online viewing)',
740 'size' => CRM_Utils_Type
::BIG
,
741 'default' => 'Public Pages',
742 'table_name' => 'civicrm_mailing',
743 'entity' => 'Mailing',
744 'bao' => 'CRM_Mailing_BAO_Mailing',
748 'pseudoconstant' => array(
749 'callback' => 'CRM_Core_SelectValues::groupVisibility',
752 'campaign_id' => array(
753 'name' => 'campaign_id',
754 'type' => CRM_Utils_Type
::T_INT
,
755 'title' => ts('Mailing Campaign') ,
756 'description' => 'The campaign for which this mailing has been initiated.',
757 'table_name' => 'civicrm_mailing',
758 'entity' => 'Mailing',
759 'bao' => 'CRM_Mailing_BAO_Mailing',
760 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
764 'pseudoconstant' => array(
765 'table' => 'civicrm_campaign',
767 'labelColumn' => 'title',
770 'dedupe_email' => array(
771 'name' => 'dedupe_email',
772 'type' => CRM_Utils_Type
::T_BOOLEAN
,
773 'title' => ts('No Duplicate emails?') ,
774 'description' => 'Remove duplicate emails?',
775 'table_name' => 'civicrm_mailing',
776 'entity' => 'Mailing',
777 'bao' => 'CRM_Mailing_BAO_Mailing',
779 'type' => 'CheckBox',
782 'sms_provider_id' => array(
783 'name' => 'sms_provider_id',
784 'type' => CRM_Utils_Type
::T_INT
,
785 'title' => ts('Mailing SMS Provider') ,
786 'table_name' => 'civicrm_mailing',
787 'entity' => 'Mailing',
788 'bao' => 'CRM_Mailing_BAO_Mailing',
789 'FKClassName' => 'CRM_SMS_DAO_Provider',
796 'type' => CRM_Utils_Type
::T_STRING
,
797 'title' => ts('Mailing Hash') ,
798 'description' => 'Key for validating requests related to this mailing.',
800 'size' => CRM_Utils_Type
::TWELVE
,
801 'table_name' => 'civicrm_mailing',
802 'entity' => 'Mailing',
803 'bao' => 'CRM_Mailing_BAO_Mailing',
805 'location_type_id' => array(
806 'name' => 'location_type_id',
807 'type' => CRM_Utils_Type
::T_INT
,
808 'title' => ts('Location Type') ,
809 'description' => 'With email_selection_method, determines which email address to use',
810 'table_name' => 'civicrm_mailing',
811 'entity' => 'Mailing',
812 'bao' => 'CRM_Mailing_BAO_Mailing',
813 'FKClassName' => 'CRM_Core_DAO_LocationType',
814 'pseudoconstant' => array(
815 'table' => 'civicrm_location_type',
817 'labelColumn' => 'display_name',
820 'email_selection_method' => array(
821 'name' => 'email_selection_method',
822 'type' => CRM_Utils_Type
::T_STRING
,
823 'title' => ts('Email Selection Method') ,
824 'description' => 'With location_type_id, determine how to choose the email address to use.',
826 'size' => CRM_Utils_Type
::MEDIUM
,
827 'default' => 'automatic',
828 'table_name' => 'civicrm_mailing',
829 'entity' => 'Mailing',
830 'bao' => 'CRM_Mailing_BAO_Mailing',
831 'pseudoconstant' => array(
832 'callback' => 'CRM_Core_SelectValues::emailSelectMethods',
836 'name' => 'language',
837 'type' => CRM_Utils_Type
::T_STRING
,
838 'title' => ts('Mailing Language') ,
839 'description' => 'Language of the content of the mailing. Useful for tokens.',
841 'size' => CRM_Utils_Type
::SIX
,
842 'table_name' => 'civicrm_mailing',
843 'entity' => 'Mailing',
844 'bao' => 'CRM_Mailing_BAO_Mailing',
848 'pseudoconstant' => array(
849 'optionGroupName' => 'languages',
850 'keyColumn' => 'name',
851 'optionEditPath' => 'civicrm/admin/options/languages',
855 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
857 return Civi
::$statics[__CLASS__
]['fields'];
860 * Return a mapping from field-name to the corresponding key (as used in fields()).
863 * Array(string $name => string $uniqueName).
865 static function &fieldKeys() {
866 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
867 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
869 return Civi
::$statics[__CLASS__
]['fieldKeys'];
872 * Returns the names of this table
876 static function getTableName() {
877 return self
::$_tableName;
880 * Returns if this table needs to be logged
888 * Returns the list of fields that can be imported
890 * @param bool $prefix
894 static function &import($prefix = false) {
895 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing', $prefix, array());
899 * Returns the list of fields that can be exported
901 * @param bool $prefix
905 static function &export($prefix = false) {
906 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing', $prefix, array());