5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Mailing/Mailing.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:5a53b90adc8124a3af37701d7a50b822)
13 * Database access object for the Mailing entity.
15 class CRM_Mailing_DAO_Mailing
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mailing';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
37 * Which site is this mailing for
44 * FK to the header component.
51 * FK to the footer component.
58 * FK to the auto-responder component.
65 * FK to the unsubscribe component.
69 public $unsubscribe_id;
74 public $resubscribe_id;
77 * FK to the opt-out component.
91 * differentiate between standalone mailings, A/B tests, and A/B final-winner
98 * From Header of mailing
105 * From Email of mailing
112 * Reply-To Email of mailing
116 public $replyto_email;
119 * The language/processing system used for email templates.
123 public $template_type;
126 * Advanced options used by the email templating system. (JSON encoded)
130 public $template_options;
140 * Body of the mailing in text format.
147 * Body of the mailing in html format.
154 * Should we track URL click-throughs for this mailing?
158 public $url_tracking;
161 * Should we forward replies back to the author?
165 public $forward_replies;
168 * Should we enable the auto-responder?
172 public $auto_responder;
175 * Should we track when recipients open/read this mailing?
179 public $open_tracking;
182 * Has at least one job associated with this mailing finished?
186 public $is_completed;
189 * FK to the message template.
193 public $msg_template_id;
196 * Should we overrite VERP address in Reply-To
200 public $override_verp;
203 * FK to Contact ID who first created this mailing
210 * Date and time this mailing was created.
214 public $created_date;
217 * When the mailing (or closely related entity) was created or modified or deleted.
221 public $modified_date;
224 * FK to Contact ID who scheduled this mailing
228 public $scheduled_id;
231 * Date and time this mailing was scheduled.
235 public $scheduled_date;
238 * FK to Contact ID who approved this mailing
245 * Date and time this mailing was approved.
249 public $approval_date;
252 * The status of this mailing. Values: none, approved, rejected
256 public $approval_status_id;
259 * Note behind the decision.
263 public $approval_note;
266 * Is this mailing archived?
273 * In what context(s) is the mailing contents visible (online viewing)
280 * The campaign for which this mailing has been initiated.
287 * Remove duplicate emails?
291 public $dedupe_email;
296 public $sms_provider_id;
299 * Key for validating requests related to this mailing.
306 * With email_selection_method, determines which email address to use
310 public $location_type_id;
313 * With location_type_id, determine how to choose the email address to use.
317 public $email_selection_method;
320 * Language of the content of the mailing. Useful for tokens.
329 public function __construct() {
330 $this->__table
= 'civicrm_mailing';
331 parent
::__construct();
335 * Returns foreign keys and entity references.
338 * [CRM_Core_Reference_Interface]
340 public static function getReferenceColumns() {
341 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
342 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
343 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
344 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'header_id', 'civicrm_mailing_component', 'id');
345 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'footer_id', 'civicrm_mailing_component', 'id');
346 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'reply_id', 'civicrm_mailing_component', 'id');
347 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'unsubscribe_id', 'civicrm_mailing_component', 'id');
348 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'optout_id', 'civicrm_mailing_component', 'id');
349 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id');
350 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
351 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'scheduled_id', 'civicrm_contact', 'id');
352 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'approver_id', 'civicrm_contact', 'id');
353 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
354 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id');
355 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'location_type_id', 'civicrm_location_type', 'id');
356 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
358 return Civi
::$statics[__CLASS__
]['links'];
362 * Returns all the column names of this table
366 public static function &fields() {
367 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
368 Civi
::$statics[__CLASS__
]['fields'] = [
371 'type' => CRM_Utils_Type
::T_INT
,
372 'title' => ts('Mailing ID'),
374 'table_name' => 'civicrm_mailing',
375 'entity' => 'Mailing',
376 'bao' => 'CRM_Mailing_BAO_Mailing',
380 'name' => 'domain_id',
381 'type' => CRM_Utils_Type
::T_INT
,
382 'title' => ts('Mailing Domain'),
383 'description' => ts('Which site is this mailing for'),
384 'table_name' => 'civicrm_mailing',
385 'entity' => 'Mailing',
386 'bao' => 'CRM_Mailing_BAO_Mailing',
388 'FKClassName' => 'CRM_Core_DAO_Domain',
389 'pseudoconstant' => [
390 'table' => 'civicrm_domain',
392 'labelColumn' => 'name',
396 'name' => 'header_id',
397 'type' => CRM_Utils_Type
::T_INT
,
398 'title' => ts('Mailing Header'),
399 'description' => ts('FK to the header component.'),
400 'table_name' => 'civicrm_mailing',
401 'entity' => 'Mailing',
402 'bao' => 'CRM_Mailing_BAO_Mailing',
404 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
407 'name' => 'footer_id',
408 'type' => CRM_Utils_Type
::T_INT
,
409 'title' => ts('Mailing Footer'),
410 'description' => ts('FK to the footer component.'),
411 'table_name' => 'civicrm_mailing',
412 'entity' => 'Mailing',
413 'bao' => 'CRM_Mailing_BAO_Mailing',
415 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
418 'name' => 'reply_id',
419 'type' => CRM_Utils_Type
::T_INT
,
420 'title' => ts('Mailing Reply'),
421 'description' => ts('FK to the auto-responder component.'),
422 'table_name' => 'civicrm_mailing',
423 'entity' => 'Mailing',
424 'bao' => 'CRM_Mailing_BAO_Mailing',
426 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
428 'unsubscribe_id' => [
429 'name' => 'unsubscribe_id',
430 'type' => CRM_Utils_Type
::T_INT
,
431 'title' => ts('Mailing Unsubscribe'),
432 'description' => ts('FK to the unsubscribe component.'),
433 'table_name' => 'civicrm_mailing',
434 'entity' => 'Mailing',
435 'bao' => 'CRM_Mailing_BAO_Mailing',
437 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
439 'resubscribe_id' => [
440 'name' => 'resubscribe_id',
441 'type' => CRM_Utils_Type
::T_INT
,
442 'title' => ts('Mailing Resubscribe'),
443 'table_name' => 'civicrm_mailing',
444 'entity' => 'Mailing',
445 'bao' => 'CRM_Mailing_BAO_Mailing',
449 'name' => 'optout_id',
450 'type' => CRM_Utils_Type
::T_INT
,
451 'title' => ts('Mailing Opt Out'),
452 'description' => ts('FK to the opt-out component.'),
453 'table_name' => 'civicrm_mailing',
454 'entity' => 'Mailing',
455 'bao' => 'CRM_Mailing_BAO_Mailing',
457 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
461 'type' => CRM_Utils_Type
::T_STRING
,
462 'title' => ts('Mailing Name'),
463 'description' => ts('Mailing Name.'),
465 'size' => CRM_Utils_Type
::HUGE
,
466 'table_name' => 'civicrm_mailing',
467 'entity' => 'Mailing',
468 'bao' => 'CRM_Mailing_BAO_Mailing',
475 'name' => 'mailing_type',
476 'type' => CRM_Utils_Type
::T_STRING
,
477 'title' => ts('Mailing Type'),
478 'description' => ts('differentiate between standalone mailings, A/B tests, and A/B final-winner'),
480 'size' => CRM_Utils_Type
::MEDIUM
,
481 'table_name' => 'civicrm_mailing',
482 'entity' => 'Mailing',
483 'bao' => 'CRM_Mailing_BAO_Mailing',
488 'pseudoconstant' => [
489 'callback' => 'CRM_Mailing_PseudoConstant::mailingTypes',
493 'name' => 'from_name',
494 'type' => CRM_Utils_Type
::T_STRING
,
495 'title' => ts('Mailing From Name'),
496 'description' => ts('From Header of mailing'),
498 'size' => CRM_Utils_Type
::HUGE
,
499 'table_name' => 'civicrm_mailing',
500 'entity' => 'Mailing',
501 'bao' => 'CRM_Mailing_BAO_Mailing',
508 'name' => 'from_email',
509 'type' => CRM_Utils_Type
::T_STRING
,
510 'title' => ts('Mailing From Email'),
511 'description' => ts('From Email of mailing'),
513 'size' => CRM_Utils_Type
::HUGE
,
514 'table_name' => 'civicrm_mailing',
515 'entity' => 'Mailing',
516 'bao' => 'CRM_Mailing_BAO_Mailing',
523 'name' => 'replyto_email',
524 'type' => CRM_Utils_Type
::T_STRING
,
525 'title' => ts('Replyto Email'),
526 'description' => ts('Reply-To Email of mailing'),
528 'size' => CRM_Utils_Type
::HUGE
,
529 'table_name' => 'civicrm_mailing',
530 'entity' => 'Mailing',
531 'bao' => 'CRM_Mailing_BAO_Mailing',
538 'name' => 'template_type',
539 'type' => CRM_Utils_Type
::T_STRING
,
540 'title' => ts('Template Type'),
541 'description' => ts('The language/processing system used for email templates.'),
544 'size' => CRM_Utils_Type
::BIG
,
545 'default' => 'traditional',
546 'table_name' => 'civicrm_mailing',
547 'entity' => 'Mailing',
548 'bao' => 'CRM_Mailing_BAO_Mailing',
550 'pseudoconstant' => [
551 'callback' => 'CRM_Mailing_BAO_Mailing::getTemplateTypeNames',
554 'template_options' => [
555 'name' => 'template_options',
556 'type' => CRM_Utils_Type
::T_LONGTEXT
,
557 'title' => ts('Template Options (JSON)'),
558 'description' => ts('Advanced options used by the email templating system. (JSON encoded)'),
559 'table_name' => 'civicrm_mailing',
560 'entity' => 'Mailing',
561 'bao' => 'CRM_Mailing_BAO_Mailing',
566 'type' => CRM_Utils_Type
::T_STRING
,
567 'title' => ts('Subject'),
568 'description' => ts('Subject of mailing'),
570 'size' => CRM_Utils_Type
::HUGE
,
571 'table_name' => 'civicrm_mailing',
572 'entity' => 'Mailing',
573 'bao' => 'CRM_Mailing_BAO_Mailing',
580 'name' => 'body_text',
581 'type' => CRM_Utils_Type
::T_LONGTEXT
,
582 'title' => ts('Body Text'),
583 'description' => ts('Body of the mailing in text format.'),
584 'table_name' => 'civicrm_mailing',
585 'entity' => 'Mailing',
586 'bao' => 'CRM_Mailing_BAO_Mailing',
590 'name' => 'body_html',
591 'type' => CRM_Utils_Type
::T_LONGTEXT
,
592 'title' => ts('Body Html'),
593 'description' => ts('Body of the mailing in html format.'),
594 'table_name' => 'civicrm_mailing',
595 'entity' => 'Mailing',
596 'bao' => 'CRM_Mailing_BAO_Mailing',
600 'name' => 'url_tracking',
601 'type' => CRM_Utils_Type
::T_BOOLEAN
,
602 'title' => ts('Url Tracking'),
603 'description' => ts('Should we track URL click-throughs for this mailing?'),
604 'table_name' => 'civicrm_mailing',
605 'entity' => 'Mailing',
606 'bao' => 'CRM_Mailing_BAO_Mailing',
609 'type' => 'CheckBox',
612 'forward_replies' => [
613 'name' => 'forward_replies',
614 'type' => CRM_Utils_Type
::T_BOOLEAN
,
615 'title' => ts('Forward Replies'),
616 'description' => ts('Should we forward replies back to the author?'),
617 'table_name' => 'civicrm_mailing',
618 'entity' => 'Mailing',
619 'bao' => 'CRM_Mailing_BAO_Mailing',
622 'type' => 'CheckBox',
625 'auto_responder' => [
626 'name' => 'auto_responder',
627 'type' => CRM_Utils_Type
::T_BOOLEAN
,
628 'title' => ts('Auto Responder'),
629 'description' => ts('Should we enable the auto-responder?'),
630 'table_name' => 'civicrm_mailing',
631 'entity' => 'Mailing',
632 'bao' => 'CRM_Mailing_BAO_Mailing',
635 'type' => 'CheckBox',
639 'name' => 'open_tracking',
640 'type' => CRM_Utils_Type
::T_BOOLEAN
,
641 'title' => ts('Track Mailing?'),
642 'description' => ts('Should we track when recipients open/read this mailing?'),
643 'table_name' => 'civicrm_mailing',
644 'entity' => 'Mailing',
645 'bao' => 'CRM_Mailing_BAO_Mailing',
649 'name' => 'is_completed',
650 'type' => CRM_Utils_Type
::T_BOOLEAN
,
651 'title' => ts('Mailing Completed'),
652 'description' => ts('Has at least one job associated with this mailing finished?'),
653 'table_name' => 'civicrm_mailing',
654 'entity' => 'Mailing',
655 'bao' => 'CRM_Mailing_BAO_Mailing',
658 'type' => 'CheckBox',
661 'msg_template_id' => [
662 'name' => 'msg_template_id',
663 'type' => CRM_Utils_Type
::T_INT
,
664 'title' => ts('Mailing Message Template'),
665 'description' => ts('FK to the message template.'),
666 'table_name' => 'civicrm_mailing',
667 'entity' => 'Mailing',
668 'bao' => 'CRM_Mailing_BAO_Mailing',
670 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
673 'name' => 'override_verp',
674 'type' => CRM_Utils_Type
::T_BOOLEAN
,
675 'title' => ts('Override Verp'),
676 'description' => ts('Should we overrite VERP address in Reply-To'),
678 'table_name' => 'civicrm_mailing',
679 'entity' => 'Mailing',
680 'bao' => 'CRM_Mailing_BAO_Mailing',
683 'type' => 'CheckBox',
687 'name' => 'created_id',
688 'type' => CRM_Utils_Type
::T_INT
,
689 'title' => ts('Mailing Creator'),
690 'description' => ts('FK to Contact ID who first created this mailing'),
691 'table_name' => 'civicrm_mailing',
692 'entity' => 'Mailing',
693 'bao' => 'CRM_Mailing_BAO_Mailing',
695 'FKClassName' => 'CRM_Contact_DAO_Contact',
698 'name' => 'created_date',
699 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
700 'title' => ts('Mailing Created Date'),
701 'description' => ts('Date and time this mailing was created.'),
704 'table_name' => 'civicrm_mailing',
705 'entity' => 'Mailing',
706 'bao' => 'CRM_Mailing_BAO_Mailing',
709 'type' => 'Select Date',
710 'formatType' => 'activityDateTime',
713 'mailing_modified_date' => [
714 'name' => 'modified_date',
715 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
716 'title' => ts('Modified Date'),
717 'description' => ts('When the mailing (or closely related entity) was created or modified or deleted.'),
720 'where' => 'civicrm_mailing.modified_date',
721 'headerPattern' => '',
723 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
724 'table_name' => 'civicrm_mailing',
725 'entity' => 'Mailing',
726 'bao' => 'CRM_Mailing_BAO_Mailing',
730 'name' => 'scheduled_id',
731 'type' => CRM_Utils_Type
::T_INT
,
732 'title' => ts('Scheduled By'),
733 'description' => ts('FK to Contact ID who scheduled this mailing'),
734 'table_name' => 'civicrm_mailing',
735 'entity' => 'Mailing',
736 'bao' => 'CRM_Mailing_BAO_Mailing',
738 'FKClassName' => 'CRM_Contact_DAO_Contact',
740 'scheduled_date' => [
741 'name' => 'scheduled_date',
742 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
743 'title' => ts('Mailing Scheduled Date'),
744 'description' => ts('Date and time this mailing was scheduled.'),
747 'table_name' => 'civicrm_mailing',
748 'entity' => 'Mailing',
749 'bao' => 'CRM_Mailing_BAO_Mailing',
752 'type' => 'Select Date',
753 'formatType' => 'activityDateTime',
757 'name' => 'approver_id',
758 'type' => CRM_Utils_Type
::T_INT
,
759 'title' => ts('Approved By'),
760 'description' => ts('FK to Contact ID who approved this mailing'),
761 'table_name' => 'civicrm_mailing',
762 'entity' => 'Mailing',
763 'bao' => 'CRM_Mailing_BAO_Mailing',
765 'FKClassName' => 'CRM_Contact_DAO_Contact',
768 'name' => 'approval_date',
769 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
770 'title' => ts('Mailing Approved Date'),
771 'description' => ts('Date and time this mailing was approved.'),
774 'table_name' => 'civicrm_mailing',
775 'entity' => 'Mailing',
776 'bao' => 'CRM_Mailing_BAO_Mailing',
779 'type' => 'Select Date',
780 'formatType' => 'activityDateTime',
783 'approval_status_id' => [
784 'name' => 'approval_status_id',
785 'type' => CRM_Utils_Type
::T_INT
,
786 'title' => ts('Approval Status'),
787 'description' => ts('The status of this mailing. Values: none, approved, rejected'),
788 'table_name' => 'civicrm_mailing',
789 'entity' => 'Mailing',
790 'bao' => 'CRM_Mailing_BAO_Mailing',
795 'pseudoconstant' => [
796 'optionGroupName' => 'mail_approval_status',
797 'optionEditPath' => 'civicrm/admin/options/mail_approval_status',
801 'name' => 'approval_note',
802 'type' => CRM_Utils_Type
::T_LONGTEXT
,
803 'title' => ts('Approval Note'),
804 'description' => ts('Note behind the decision.'),
805 'table_name' => 'civicrm_mailing',
806 'entity' => 'Mailing',
807 'bao' => 'CRM_Mailing_BAO_Mailing',
810 'type' => 'TextArea',
814 'name' => 'is_archived',
815 'type' => CRM_Utils_Type
::T_BOOLEAN
,
816 'title' => ts('Is Mailing Archived?'),
817 'description' => ts('Is this mailing archived?'),
819 'table_name' => 'civicrm_mailing',
820 'entity' => 'Mailing',
821 'bao' => 'CRM_Mailing_BAO_Mailing',
824 'type' => 'CheckBox',
828 'name' => 'visibility',
829 'type' => CRM_Utils_Type
::T_STRING
,
830 'title' => ts('Mailing Visibility'),
831 'description' => ts('In what context(s) is the mailing contents visible (online viewing)'),
833 'size' => CRM_Utils_Type
::BIG
,
834 'default' => 'Public Pages',
835 'table_name' => 'civicrm_mailing',
836 'entity' => 'Mailing',
837 'bao' => 'CRM_Mailing_BAO_Mailing',
842 'pseudoconstant' => [
843 'callback' => 'CRM_Core_SelectValues::groupVisibility',
847 'name' => 'campaign_id',
848 'type' => CRM_Utils_Type
::T_INT
,
849 'title' => ts('Mailing Campaign'),
850 'description' => ts('The campaign for which this mailing has been initiated.'),
851 'table_name' => 'civicrm_mailing',
852 'entity' => 'Mailing',
853 'bao' => 'CRM_Mailing_BAO_Mailing',
855 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
859 'pseudoconstant' => [
860 'table' => 'civicrm_campaign',
862 'labelColumn' => 'title',
866 'name' => 'dedupe_email',
867 'type' => CRM_Utils_Type
::T_BOOLEAN
,
868 'title' => ts('No Duplicate emails?'),
869 'description' => ts('Remove duplicate emails?'),
871 'table_name' => 'civicrm_mailing',
872 'entity' => 'Mailing',
873 'bao' => 'CRM_Mailing_BAO_Mailing',
876 'type' => 'CheckBox',
879 'sms_provider_id' => [
880 'name' => 'sms_provider_id',
881 'type' => CRM_Utils_Type
::T_INT
,
882 'title' => ts('Mailing SMS Provider'),
883 'table_name' => 'civicrm_mailing',
884 'entity' => 'Mailing',
885 'bao' => 'CRM_Mailing_BAO_Mailing',
887 'FKClassName' => 'CRM_SMS_DAO_Provider',
894 'type' => CRM_Utils_Type
::T_STRING
,
895 'title' => ts('Mailing Hash'),
896 'description' => ts('Key for validating requests related to this mailing.'),
898 'size' => CRM_Utils_Type
::TWELVE
,
899 'table_name' => 'civicrm_mailing',
900 'entity' => 'Mailing',
901 'bao' => 'CRM_Mailing_BAO_Mailing',
904 'location_type_id' => [
905 'name' => 'location_type_id',
906 'type' => CRM_Utils_Type
::T_INT
,
907 'title' => ts('Location Type'),
908 'description' => ts('With email_selection_method, determines which email address to use'),
909 'table_name' => 'civicrm_mailing',
910 'entity' => 'Mailing',
911 'bao' => 'CRM_Mailing_BAO_Mailing',
913 'FKClassName' => 'CRM_Core_DAO_LocationType',
914 'pseudoconstant' => [
915 'table' => 'civicrm_location_type',
917 'labelColumn' => 'display_name',
920 'email_selection_method' => [
921 'name' => 'email_selection_method',
922 'type' => CRM_Utils_Type
::T_STRING
,
923 'title' => ts('Email Selection Method'),
924 'description' => ts('With location_type_id, determine how to choose the email address to use.'),
926 'size' => CRM_Utils_Type
::MEDIUM
,
927 'default' => 'automatic',
928 'table_name' => 'civicrm_mailing',
929 'entity' => 'Mailing',
930 'bao' => 'CRM_Mailing_BAO_Mailing',
932 'pseudoconstant' => [
933 'callback' => 'CRM_Core_SelectValues::emailSelectMethods',
937 'name' => 'language',
938 'type' => CRM_Utils_Type
::T_STRING
,
939 'title' => ts('Mailing Language'),
940 'description' => ts('Language of the content of the mailing. Useful for tokens.'),
942 'size' => CRM_Utils_Type
::SIX
,
943 'table_name' => 'civicrm_mailing',
944 'entity' => 'Mailing',
945 'bao' => 'CRM_Mailing_BAO_Mailing',
950 'pseudoconstant' => [
951 'optionGroupName' => 'languages',
952 'keyColumn' => 'name',
953 'optionEditPath' => 'civicrm/admin/options/languages',
957 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
959 return Civi
::$statics[__CLASS__
]['fields'];
963 * Return a mapping from field-name to the corresponding key (as used in fields()).
966 * Array(string $name => string $uniqueName).
968 public static function &fieldKeys() {
969 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
970 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
972 return Civi
::$statics[__CLASS__
]['fieldKeys'];
976 * Returns the names of this table
980 public static function getTableName() {
981 return self
::$_tableName;
985 * Returns if this table needs to be logged
989 public function getLog() {
994 * Returns the list of fields that can be imported
996 * @param bool $prefix
1000 public static function &import($prefix = FALSE) {
1001 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing', $prefix, []);
1006 * Returns the list of fields that can be exported
1008 * @param bool $prefix
1012 public static function &export($prefix = FALSE) {
1013 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing', $prefix, []);
1018 * Returns the list of indices
1020 * @param bool $localize
1024 public static function indices($localize = TRUE) {
1027 'name' => 'index_hash',
1031 'localizable' => FALSE,
1032 'sig' => 'civicrm_mailing::0::hash',
1035 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;