From e45a8e7aba3de4cdb79674d1e377c83899f943c9 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 16 Nov 2022 14:10:46 -0500 Subject: [PATCH] Mailing - Rename DAO files for better short names --- CRM/Contact/BAO/Group.php | 2 +- CRM/Core/DAO/AllCoreTables.data.php | 64 ++-- CRM/Mailing/BAO/Query.php | 4 +- CRM/Mailing/BAO/Recipients.php | 2 +- CRM/Mailing/DAO/MailingRecipients.php | 278 ++++++++++++++++ CRM/Mailing/DAO/Recipients.php | 276 +--------------- CRM/Mailing/Event/BAO/Bounce.php | 2 +- CRM/Mailing/Event/BAO/Confirm.php | 2 +- CRM/Mailing/Event/BAO/Delivered.php | 2 +- CRM/Mailing/Event/BAO/Forward.php | 2 +- CRM/Mailing/Event/BAO/Opened.php | 2 +- CRM/Mailing/Event/BAO/Queue.php | 2 +- CRM/Mailing/Event/BAO/Reply.php | 4 +- CRM/Mailing/Event/BAO/Subscribe.php | 2 +- CRM/Mailing/Event/BAO/TrackableURLOpen.php | 2 +- CRM/Mailing/Event/BAO/Unsubscribe.php | 2 +- CRM/Mailing/Event/DAO/Bounce.php | 270 +-------------- CRM/Mailing/Event/DAO/Confirm.php | 218 +----------- CRM/Mailing/Event/DAO/Delivered.php | 218 +----------- CRM/Mailing/Event/DAO/Forward.php | 244 +------------- CRM/Mailing/Event/DAO/MailingEventBounce.php | 272 +++++++++++++++ .../Event/DAO/MailingEventClickThrough.php | 247 ++++++++++++++ CRM/Mailing/Event/DAO/MailingEventConfirm.php | 220 +++++++++++++ .../Event/DAO/MailingEventDelivered.php | 220 +++++++++++++ CRM/Mailing/Event/DAO/MailingEventForward.php | 246 ++++++++++++++ CRM/Mailing/Event/DAO/MailingEventOpened.php | 220 +++++++++++++ CRM/Mailing/Event/DAO/MailingEventQueue.php | 311 ++++++++++++++++++ CRM/Mailing/Event/DAO/MailingEventReply.php | 220 +++++++++++++ .../Event/DAO/MailingEventSubscribe.php | 277 ++++++++++++++++ .../Event/DAO/MailingEventUnsubscribe.php | 242 ++++++++++++++ CRM/Mailing/Event/DAO/Opened.php | 218 +----------- CRM/Mailing/Event/DAO/Queue.php | 309 +---------------- CRM/Mailing/Event/DAO/Reply.php | 218 +----------- CRM/Mailing/Event/DAO/Subscribe.php | 275 +--------------- CRM/Mailing/Event/DAO/TrackableURLOpen.php | 245 +------------- CRM/Mailing/Event/DAO/Unsubscribe.php | 240 +------------- CRM/Mailing/Form/ForwardMailing.php | 2 +- CRM/Report/Form/Mailing/Clicks.php | 2 +- CRM/Report/Form/Mailing/Detail.php | 10 +- CRM/Report/Form/Mailing/Opened.php | 2 +- CRM/Utils/VersionCheck.php | 2 +- api/v3/Mailing.php | 4 +- api/v3/utils.php | 9 - ext/flexmailer/src/FlexMailerTask.php | 4 +- tests/phpunit/CRM/Core/PseudoConstantTest.php | 4 +- tests/phpunit/api/v3/MailingTest.php | 4 +- .../{Bounce.xml => MailingEventBounce.xml} | 2 +- ...LOpen.xml => MailingEventClickThrough.xml} | 2 +- .../{Confirm.xml => MailingEventConfirm.xml} | 2 +- ...elivered.xml => MailingEventDelivered.xml} | 2 +- .../{Forward.xml => MailingEventForward.xml} | 2 +- .../{Opened.xml => MailingEventOpened.xml} | 2 +- .../{Queue.xml => MailingEventQueue.xml} | 2 +- .../{Reply.xml => MailingEventReply.xml} | 2 +- ...ubscribe.xml => MailingEventSubscribe.xml} | 2 +- ...scribe.xml => MailingEventUnsubscribe.xml} | 2 +- xml/schema/Mailing/Event/files.xml | 20 +- .../{Component.xml => MailingComponent.xml} | 0 .../{Recipients.xml => MailingRecipients.xml} | 6 +- xml/schema/Mailing/files.xml | 4 +- 60 files changed, 2864 insertions(+), 2807 deletions(-) create mode 100644 CRM/Mailing/DAO/MailingRecipients.php create mode 100644 CRM/Mailing/Event/DAO/MailingEventBounce.php create mode 100644 CRM/Mailing/Event/DAO/MailingEventClickThrough.php create mode 100644 CRM/Mailing/Event/DAO/MailingEventConfirm.php create mode 100644 CRM/Mailing/Event/DAO/MailingEventDelivered.php create mode 100644 CRM/Mailing/Event/DAO/MailingEventForward.php create mode 100644 CRM/Mailing/Event/DAO/MailingEventOpened.php create mode 100644 CRM/Mailing/Event/DAO/MailingEventQueue.php create mode 100644 CRM/Mailing/Event/DAO/MailingEventReply.php create mode 100644 CRM/Mailing/Event/DAO/MailingEventSubscribe.php create mode 100644 CRM/Mailing/Event/DAO/MailingEventUnsubscribe.php rename xml/schema/Mailing/Event/{Bounce.xml => MailingEventBounce.xml} (98%) rename xml/schema/Mailing/Event/{TrackableURLOpen.xml => MailingEventClickThrough.xml} (97%) rename xml/schema/Mailing/Event/{Confirm.xml => MailingEventConfirm.xml} (97%) rename xml/schema/Mailing/Event/{Delivered.xml => MailingEventDelivered.xml} (97%) rename xml/schema/Mailing/Event/{Forward.xml => MailingEventForward.xml} (97%) rename xml/schema/Mailing/Event/{Opened.xml => MailingEventOpened.xml} (97%) rename xml/schema/Mailing/Event/{Queue.xml => MailingEventQueue.xml} (98%) rename xml/schema/Mailing/Event/{Reply.xml => MailingEventReply.xml} (97%) rename xml/schema/Mailing/Event/{Subscribe.xml => MailingEventSubscribe.xml} (98%) rename xml/schema/Mailing/Event/{Unsubscribe.xml => MailingEventUnsubscribe.xml} (97%) rename xml/schema/Mailing/{Component.xml => MailingComponent.xml} (100%) rename xml/schema/Mailing/{Recipients.xml => MailingRecipients.xml} (94%) diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 665b7f9973..15ce4f7128 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -52,7 +52,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { // added for CRM-1631 and CRM-1794 // delete all subscribed mails with the selected group id - $subscribe = new CRM_Mailing_Event_DAO_Subscribe(); + $subscribe = new CRM_Mailing_Event_DAO_MailingEventSubscribe(); $subscribe->group_id = $id; $subscribe->delete(); diff --git a/CRM/Core/DAO/AllCoreTables.data.php b/CRM/Core/DAO/AllCoreTables.data.php index 872b1cddea..456041dd3f 100644 --- a/CRM/Core/DAO/AllCoreTables.data.php +++ b/CRM/Core/DAO/AllCoreTables.data.php @@ -432,14 +432,14 @@ return [ 'class' => 'CRM_Contact_DAO_GroupOrganization', 'table' => 'civicrm_group_organization', ], - 'CRM_Mailing_Event_DAO_Subscribe' => [ - 'name' => 'Subscribe', - 'class' => 'CRM_Mailing_Event_DAO_Subscribe', + 'CRM_Mailing_Event_DAO_MailingEventSubscribe' => [ + 'name' => 'MailingEventSubscribe', + 'class' => 'CRM_Mailing_Event_DAO_MailingEventSubscribe', 'table' => 'civicrm_mailing_event_subscribe', ], - 'CRM_Mailing_Event_DAO_Confirm' => [ - 'name' => 'Confirm', - 'class' => 'CRM_Mailing_Event_DAO_Confirm', + 'CRM_Mailing_Event_DAO_MailingEventConfirm' => [ + 'name' => 'MailingEventConfirm', + 'class' => 'CRM_Mailing_Event_DAO_MailingEventConfirm', 'table' => 'civicrm_mailing_event_confirm', ], 'CRM_Contribute_DAO_ContributionPage' => [ @@ -602,9 +602,9 @@ return [ 'class' => 'CRM_Mailing_DAO_MailingJob', 'table' => 'civicrm_mailing_job', ], - 'CRM_Mailing_DAO_Recipients' => [ - 'name' => 'Recipients', - 'class' => 'CRM_Mailing_DAO_Recipients', + 'CRM_Mailing_DAO_MailingRecipients' => [ + 'name' => 'MailingRecipients', + 'class' => 'CRM_Mailing_DAO_MailingRecipients', 'table' => 'civicrm_mailing_recipients', ], 'CRM_Mailing_DAO_Spool' => [ @@ -612,44 +612,44 @@ return [ 'class' => 'CRM_Mailing_DAO_Spool', 'table' => 'civicrm_mailing_spool', ], - 'CRM_Mailing_Event_DAO_Queue' => [ + 'CRM_Mailing_Event_DAO_MailingEventQueue' => [ 'name' => 'MailingEventQueue', - 'class' => 'CRM_Mailing_Event_DAO_Queue', + 'class' => 'CRM_Mailing_Event_DAO_MailingEventQueue', 'table' => 'civicrm_mailing_event_queue', ], - 'CRM_Mailing_Event_DAO_Bounce' => [ - 'name' => 'Bounce', - 'class' => 'CRM_Mailing_Event_DAO_Bounce', + 'CRM_Mailing_Event_DAO_MailingEventBounce' => [ + 'name' => 'MailingEventBounce', + 'class' => 'CRM_Mailing_Event_DAO_MailingEventBounce', 'table' => 'civicrm_mailing_event_bounce', ], - 'CRM_Mailing_Event_DAO_Delivered' => [ - 'name' => 'Delivered', - 'class' => 'CRM_Mailing_Event_DAO_Delivered', + 'CRM_Mailing_Event_DAO_MailingEventDelivered' => [ + 'name' => 'MailingEventDelivered', + 'class' => 'CRM_Mailing_Event_DAO_MailingEventDelivered', 'table' => 'civicrm_mailing_event_delivered', ], - 'CRM_Mailing_Event_DAO_Forward' => [ - 'name' => 'Forward', - 'class' => 'CRM_Mailing_Event_DAO_Forward', + 'CRM_Mailing_Event_DAO_MailingEventForward' => [ + 'name' => 'MailingEventForward', + 'class' => 'CRM_Mailing_Event_DAO_MailingEventForward', 'table' => 'civicrm_mailing_event_forward', ], - 'CRM_Mailing_Event_DAO_Opened' => [ - 'name' => 'Opened', - 'class' => 'CRM_Mailing_Event_DAO_Opened', + 'CRM_Mailing_Event_DAO_MailingEventOpened' => [ + 'name' => 'MailingEventOpened', + 'class' => 'CRM_Mailing_Event_DAO_MailingEventOpened', 'table' => 'civicrm_mailing_event_opened', ], - 'CRM_Mailing_Event_DAO_Reply' => [ - 'name' => 'Reply', - 'class' => 'CRM_Mailing_Event_DAO_Reply', + 'CRM_Mailing_Event_DAO_MailingEventReply' => [ + 'name' => 'MailingEventReply', + 'class' => 'CRM_Mailing_Event_DAO_MailingEventReply', 'table' => 'civicrm_mailing_event_reply', ], - 'CRM_Mailing_Event_DAO_TrackableURLOpen' => [ - 'name' => 'TrackableURLOpen', - 'class' => 'CRM_Mailing_Event_DAO_TrackableURLOpen', + 'CRM_Mailing_Event_DAO_MailingEventClickThrough' => [ + 'name' => 'MailingEventClickThrough', + 'class' => 'CRM_Mailing_Event_DAO_MailingEventClickThrough', 'table' => 'civicrm_mailing_event_trackable_url_open', ], - 'CRM_Mailing_Event_DAO_Unsubscribe' => [ - 'name' => 'Unsubscribe', - 'class' => 'CRM_Mailing_Event_DAO_Unsubscribe', + 'CRM_Mailing_Event_DAO_MailingEventUnsubscribe' => [ + 'name' => 'MailingEventUnsubscribe', + 'class' => 'CRM_Mailing_Event_DAO_MailingEventUnsubscribe', 'table' => 'civicrm_mailing_event_unsubscribe', ], 'CRM_Contribute_DAO_ContributionRecur' => [ diff --git a/CRM/Mailing/BAO/Query.php b/CRM/Mailing/BAO/Query.php index e5440a8295..c14c361b1c 100644 --- a/CRM/Mailing/BAO/Query.php +++ b/CRM/Mailing/BAO/Query.php @@ -309,7 +309,7 @@ class CRM_Mailing_BAO_Query { 'civicrm_mailing_event_bounce', 'bounce_type_id', ts('Bounce type(s)'), - CRM_Core_PseudoConstant::get('CRM_Mailing_Event_DAO_Bounce', 'bounce_type_id', [ + CRM_Core_PseudoConstant::get('CRM_Mailing_Event_DAO_MailingEventBounce', 'bounce_type_id', [ 'keyColumn' => 'id', 'labelColumn' => 'name', ]) @@ -416,7 +416,7 @@ class CRM_Mailing_BAO_Query { $form->addElement('select', 'mailing_job_status', ts('Mailing Job Status'), $mailingJobStatuses, FALSE); $mailingBounceTypes = CRM_Core_PseudoConstant::get( - 'CRM_Mailing_Event_DAO_Bounce', 'bounce_type_id', + 'CRM_Mailing_Event_DAO_MailingEventBounce', 'bounce_type_id', ['keyColumn' => 'id', 'labelColumn' => 'name'] ); $form->add('select', 'mailing_bounce_types', ts('Bounce Types'), $mailingBounceTypes, FALSE, diff --git a/CRM/Mailing/BAO/Recipients.php b/CRM/Mailing/BAO/Recipients.php index b904aa952e..00cc93f408 100644 --- a/CRM/Mailing/BAO/Recipients.php +++ b/CRM/Mailing/BAO/Recipients.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Mailing_BAO_Recipients extends CRM_Mailing_DAO_Recipients { +class CRM_Mailing_BAO_Recipients extends CRM_Mailing_DAO_MailingRecipients { /** * @param int $mailingID diff --git a/CRM/Mailing/DAO/MailingRecipients.php b/CRM/Mailing/DAO/MailingRecipients.php new file mode 100644 index 0000000000..25d6fad894 --- /dev/null +++ b/CRM/Mailing/DAO/MailingRecipients.php @@ -0,0 +1,278 @@ +__table = 'civicrm_mailing_recipients'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Recipients') : ts('Mailing Recipient'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'mailing_id', 'civicrm_mailing', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'email_id', 'civicrm_email', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'phone_id', 'civicrm_phone', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Mailing Recipients ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_recipients.id', + 'table_name' => 'civicrm_mailing_recipients', + 'entity' => 'MailingRecipients', + 'bao' => 'CRM_Mailing_DAO_MailingRecipients', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'mailing_id' => [ + 'name' => 'mailing_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Mailing ID'), + 'description' => ts('The ID of the mailing this Job will send.'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_recipients.mailing_id', + 'table_name' => 'civicrm_mailing_recipients', + 'entity' => 'MailingRecipients', + 'bao' => 'CRM_Mailing_DAO_MailingRecipients', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_DAO_Mailing', + 'html' => [ + 'label' => ts("Mailing"), + ], + 'add' => NULL, + ], + 'contact_id' => [ + 'name' => 'contact_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Recipient ID'), + 'description' => ts('FK to Contact'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_recipients.contact_id', + 'table_name' => 'civicrm_mailing_recipients', + 'entity' => 'MailingRecipients', + 'bao' => 'CRM_Mailing_DAO_MailingRecipients', + 'localizable' => 0, + 'FKClassName' => 'CRM_Contact_DAO_Contact', + 'html' => [ + 'label' => ts("Recipient"), + ], + 'add' => NULL, + ], + 'email_id' => [ + 'name' => 'email_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Email ID'), + 'description' => ts('FK to Email'), + 'where' => 'civicrm_mailing_recipients.email_id', + 'default' => NULL, + 'table_name' => 'civicrm_mailing_recipients', + 'entity' => 'MailingRecipients', + 'bao' => 'CRM_Mailing_DAO_MailingRecipients', + 'localizable' => 0, + 'FKClassName' => 'CRM_Core_DAO_Email', + 'html' => [ + 'label' => ts("Email"), + ], + 'add' => NULL, + ], + 'phone_id' => [ + 'name' => 'phone_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Phone ID'), + 'description' => ts('FK to Phone'), + 'where' => 'civicrm_mailing_recipients.phone_id', + 'default' => NULL, + 'table_name' => 'civicrm_mailing_recipients', + 'entity' => 'MailingRecipients', + 'bao' => 'CRM_Mailing_DAO_MailingRecipients', + 'localizable' => 0, + 'FKClassName' => 'CRM_Core_DAO_Phone', + 'html' => [ + 'label' => ts("Phone"), + ], + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_recipients', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_recipients', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = []; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/DAO/Recipients.php b/CRM/Mailing/DAO/Recipients.php index b2da3f8a56..1d18586d63 100644 --- a/CRM/Mailing/DAO/Recipients.php +++ b/CRM/Mailing/DAO/Recipients.php @@ -1,278 +1,6 @@ __table = 'civicrm_mailing_recipients'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Recipients') : ts('Recipient'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'mailing_id', 'civicrm_mailing', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'email_id', 'civicrm_email', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'phone_id', 'civicrm_phone', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Mailing Recipients ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_recipients.id', - 'table_name' => 'civicrm_mailing_recipients', - 'entity' => 'Recipients', - 'bao' => 'CRM_Mailing_BAO_Recipients', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'mailing_id' => [ - 'name' => 'mailing_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Mailing ID'), - 'description' => ts('The ID of the mailing this Job will send.'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_recipients.mailing_id', - 'table_name' => 'civicrm_mailing_recipients', - 'entity' => 'Recipients', - 'bao' => 'CRM_Mailing_BAO_Recipients', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_DAO_Mailing', - 'html' => [ - 'label' => ts("Mailing"), - ], - 'add' => NULL, - ], - 'contact_id' => [ - 'name' => 'contact_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Recipient ID'), - 'description' => ts('FK to Contact'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_recipients.contact_id', - 'table_name' => 'civicrm_mailing_recipients', - 'entity' => 'Recipients', - 'bao' => 'CRM_Mailing_BAO_Recipients', - 'localizable' => 0, - 'FKClassName' => 'CRM_Contact_DAO_Contact', - 'html' => [ - 'label' => ts("Recipient"), - ], - 'add' => NULL, - ], - 'email_id' => [ - 'name' => 'email_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Email ID'), - 'description' => ts('FK to Email'), - 'where' => 'civicrm_mailing_recipients.email_id', - 'default' => NULL, - 'table_name' => 'civicrm_mailing_recipients', - 'entity' => 'Recipients', - 'bao' => 'CRM_Mailing_BAO_Recipients', - 'localizable' => 0, - 'FKClassName' => 'CRM_Core_DAO_Email', - 'html' => [ - 'label' => ts("Email"), - ], - 'add' => NULL, - ], - 'phone_id' => [ - 'name' => 'phone_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Phone ID'), - 'description' => ts('FK to Phone'), - 'where' => 'civicrm_mailing_recipients.phone_id', - 'default' => NULL, - 'table_name' => 'civicrm_mailing_recipients', - 'entity' => 'Recipients', - 'bao' => 'CRM_Mailing_BAO_Recipients', - 'localizable' => 0, - 'FKClassName' => 'CRM_Core_DAO_Phone', - 'html' => [ - 'label' => ts("Phone"), - ], - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_recipients', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_recipients', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = []; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_DAO_MailingRecipients', 'CRM_Mailing_DAO_Recipients'); diff --git a/CRM/Mailing/Event/BAO/Bounce.php b/CRM/Mailing/Event/BAO/Bounce.php index 1b6d588ea6..5ac65e6c5b 100644 --- a/CRM/Mailing/Event/BAO/Bounce.php +++ b/CRM/Mailing/Event/BAO/Bounce.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce { +class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_MailingEventBounce { /** * Create a new bounce event, update the email address if necessary diff --git a/CRM/Mailing/Event/BAO/Confirm.php b/CRM/Mailing/Event/BAO/Confirm.php index 8a446143d2..c3cb86615e 100644 --- a/CRM/Mailing/Event/BAO/Confirm.php +++ b/CRM/Mailing/Event/BAO/Confirm.php @@ -22,7 +22,7 @@ require_once 'Mail/mime.php'; /** * Class CRM_Mailing_Event_BAO_Confirm */ -class CRM_Mailing_Event_BAO_Confirm extends CRM_Mailing_Event_DAO_Confirm { +class CRM_Mailing_Event_BAO_Confirm extends CRM_Mailing_Event_DAO_MailingEventConfirm { /** * Confirm a pending subscription. diff --git a/CRM/Mailing/Event/BAO/Delivered.php b/CRM/Mailing/Event/BAO/Delivered.php index 86fa110bd0..efa55f5694 100644 --- a/CRM/Mailing/Event/BAO/Delivered.php +++ b/CRM/Mailing/Event/BAO/Delivered.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { +class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_MailingEventDelivered { /** * Create a new delivery event. diff --git a/CRM/Mailing/Event/BAO/Forward.php b/CRM/Mailing/Event/BAO/Forward.php index e6ca6bc2cc..cb881228bb 100644 --- a/CRM/Mailing/Event/BAO/Forward.php +++ b/CRM/Mailing/Event/BAO/Forward.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Mailing_Event_BAO_Forward extends CRM_Mailing_Event_DAO_Forward { +class CRM_Mailing_Event_BAO_Forward extends CRM_Mailing_Event_DAO_MailingEventForward { /** * Create a new forward event, create a new contact if necessary diff --git a/CRM/Mailing/Event/BAO/Opened.php b/CRM/Mailing/Event/BAO/Opened.php index 4242251291..4ba09ab182 100644 --- a/CRM/Mailing/Event/BAO/Opened.php +++ b/CRM/Mailing/Event/BAO/Opened.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Mailing_Event_BAO_Opened extends CRM_Mailing_Event_DAO_Opened { +class CRM_Mailing_Event_BAO_Opened extends CRM_Mailing_Event_DAO_MailingEventOpened { /** * Register an open event. diff --git a/CRM/Mailing/Event/BAO/Queue.php b/CRM/Mailing/Event/BAO/Queue.php index 22cfe10fa4..00a7bc6c03 100644 --- a/CRM/Mailing/Event/BAO/Queue.php +++ b/CRM/Mailing/Event/BAO/Queue.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Mailing_Event_BAO_Queue extends CRM_Mailing_Event_DAO_Queue { +class CRM_Mailing_Event_BAO_Queue extends CRM_Mailing_Event_DAO_MailingEventQueue { /** * Queue a new recipient. diff --git a/CRM/Mailing/Event/BAO/Reply.php b/CRM/Mailing/Event/BAO/Reply.php index 6ecf68e6ad..e70581d231 100644 --- a/CRM/Mailing/Event/BAO/Reply.php +++ b/CRM/Mailing/Event/BAO/Reply.php @@ -20,7 +20,7 @@ require_once 'Mail/mime.php'; /** * Class CRM_Mailing_Event_BAO_Reply */ -class CRM_Mailing_Event_BAO_Reply extends CRM_Mailing_Event_DAO_Reply { +class CRM_Mailing_Event_BAO_Reply extends CRM_Mailing_Event_DAO_MailingEventReply { /** * Register a reply event. @@ -199,7 +199,7 @@ class CRM_Mailing_Event_BAO_Reply extends CRM_Mailing_Event_DAO_Reply { $contacts = CRM_Contact_DAO_Contact::getTableName(); $email = CRM_Core_DAO_Email::getTableName(); - $queue = CRM_Mailing_Event_DAO_Queue::getTableName(); + $queue = CRM_Mailing_Event_DAO_MailingEventQueue::getTableName(); $eq = new CRM_Core_DAO(); $eq->query( diff --git a/CRM/Mailing/Event/BAO/Subscribe.php b/CRM/Mailing/Event/BAO/Subscribe.php index 7c59da9d6d..df37dd9e83 100644 --- a/CRM/Mailing/Event/BAO/Subscribe.php +++ b/CRM/Mailing/Event/BAO/Subscribe.php @@ -23,7 +23,7 @@ require_once 'Mail/mime.php'; /** * Class CRM_Mailing_Event_BAO_Subscribe */ -class CRM_Mailing_Event_BAO_Subscribe extends CRM_Mailing_Event_DAO_Subscribe { +class CRM_Mailing_Event_BAO_Subscribe extends CRM_Mailing_Event_DAO_MailingEventSubscribe { /** * Register a subscription event. Create a new contact if one does not diff --git a/CRM/Mailing/Event/BAO/TrackableURLOpen.php b/CRM/Mailing/Event/BAO/TrackableURLOpen.php index 95ea3f6920..1220f784b2 100644 --- a/CRM/Mailing/Event/BAO/TrackableURLOpen.php +++ b/CRM/Mailing/Event/BAO/TrackableURLOpen.php @@ -14,7 +14,7 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Mailing_Event_BAO_TrackableURLOpen extends CRM_Mailing_Event_DAO_TrackableURLOpen { +class CRM_Mailing_Event_BAO_TrackableURLOpen extends CRM_Mailing_Event_DAO_MailingEventClickThrough { /** * Track a click-through and return the URL to redirect. diff --git a/CRM/Mailing/Event/BAO/Unsubscribe.php b/CRM/Mailing/Event/BAO/Unsubscribe.php index f0fffc4814..5b53f914ef 100644 --- a/CRM/Mailing/Event/BAO/Unsubscribe.php +++ b/CRM/Mailing/Event/BAO/Unsubscribe.php @@ -22,7 +22,7 @@ require_once 'Mail/mime.php'; /** * Class CRM_Mailing_Event_BAO_Unsubscribe */ -class CRM_Mailing_Event_BAO_Unsubscribe extends CRM_Mailing_Event_DAO_Unsubscribe { +class CRM_Mailing_Event_BAO_Unsubscribe extends CRM_Mailing_Event_DAO_MailingEventUnsubscribe { /** * Unsubscribe a contact from the domain. diff --git a/CRM/Mailing/Event/DAO/Bounce.php b/CRM/Mailing/Event/DAO/Bounce.php index 5815113eea..27572dbdc1 100644 --- a/CRM/Mailing/Event/DAO/Bounce.php +++ b/CRM/Mailing/Event/DAO/Bounce.php @@ -1,272 +1,6 @@ __table = 'civicrm_mailing_event_bounce'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Mailing Bounce Events') : ts('Mailing Bounce Event'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Bounce ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_bounce.id', - 'table_name' => 'civicrm_mailing_event_bounce', - 'entity' => 'Bounce', - 'bao' => 'CRM_Mailing_Event_BAO_Bounce', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'event_queue_id' => [ - 'name' => 'event_queue_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Event Queue ID'), - 'description' => ts('FK to EventQueue'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_bounce.event_queue_id', - 'table_name' => 'civicrm_mailing_event_bounce', - 'entity' => 'Bounce', - 'bao' => 'CRM_Mailing_Event_BAO_Bounce', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', - 'html' => [ - 'label' => ts("Event Queue"), - ], - 'add' => NULL, - ], - 'bounce_type_id' => [ - 'name' => 'bounce_type_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Bounce Type'), - 'description' => ts('What type of bounce was it?'), - 'where' => 'civicrm_mailing_event_bounce.bounce_type_id', - 'table_name' => 'civicrm_mailing_event_bounce', - 'entity' => 'Bounce', - 'bao' => 'CRM_Mailing_Event_BAO_Bounce', - 'localizable' => 0, - 'html' => [ - 'type' => 'Select', - ], - 'pseudoconstant' => [ - 'table' => 'civicrm_mailing_bounce_type', - 'keyColumn' => 'id', - 'labelColumn' => 'name', - ], - 'add' => NULL, - ], - 'bounce_reason' => [ - 'name' => 'bounce_reason', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Bounce Reason'), - 'description' => ts('The reason the email bounced.'), - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - 'where' => 'civicrm_mailing_event_bounce.bounce_reason', - 'table_name' => 'civicrm_mailing_event_bounce', - 'entity' => 'Bounce', - 'bao' => 'CRM_Mailing_Event_BAO_Bounce', - 'localizable' => 0, - 'add' => NULL, - ], - 'time_stamp' => [ - 'name' => 'time_stamp', - 'type' => CRM_Utils_Type::T_TIMESTAMP, - 'title' => ts('Timestamp'), - 'description' => ts('When this bounce event occurred.'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_bounce.time_stamp', - 'default' => 'CURRENT_TIMESTAMP', - 'table_name' => 'civicrm_mailing_event_bounce', - 'entity' => 'Bounce', - 'bao' => 'CRM_Mailing_Event_BAO_Bounce', - 'localizable' => 0, - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_bounce', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_bounce', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = []; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_Event_DAO_MailingEventBounce', 'CRM_Mailing_Event_DAO_Bounce'); diff --git a/CRM/Mailing/Event/DAO/Confirm.php b/CRM/Mailing/Event/DAO/Confirm.php index c48eaa085f..8acb2e61d6 100644 --- a/CRM/Mailing/Event/DAO/Confirm.php +++ b/CRM/Mailing/Event/DAO/Confirm.php @@ -1,220 +1,6 @@ __table = 'civicrm_mailing_event_confirm'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Mailing Contribution Events') : ts('Mailing Confirmation Event'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_subscribe_id', 'civicrm_mailing_event_subscribe', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Mailing Confirmation ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_confirm.id', - 'table_name' => 'civicrm_mailing_event_confirm', - 'entity' => 'Confirm', - 'bao' => 'CRM_Mailing_Event_BAO_Confirm', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'event_subscribe_id' => [ - 'name' => 'event_subscribe_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Mailing Subscribe ID'), - 'description' => ts('FK to civicrm_mailing_event_subscribe'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_confirm.event_subscribe_id', - 'table_name' => 'civicrm_mailing_event_confirm', - 'entity' => 'Confirm', - 'bao' => 'CRM_Mailing_Event_BAO_Confirm', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_Event_DAO_Subscribe', - 'html' => [ - 'label' => ts("Mailing Subscribe"), - ], - 'add' => NULL, - ], - 'time_stamp' => [ - 'name' => 'time_stamp', - 'type' => CRM_Utils_Type::T_TIMESTAMP, - 'title' => ts('Confirm Timestamp'), - 'description' => ts('When this confirmation event occurred.'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_confirm.time_stamp', - 'default' => 'CURRENT_TIMESTAMP', - 'table_name' => 'civicrm_mailing_event_confirm', - 'entity' => 'Confirm', - 'bao' => 'CRM_Mailing_Event_BAO_Confirm', - 'localizable' => 0, - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_confirm', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_confirm', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = []; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_Event_DAO_MailingEventConfirm', 'CRM_Mailing_Event_DAO_Confirm'); diff --git a/CRM/Mailing/Event/DAO/Delivered.php b/CRM/Mailing/Event/DAO/Delivered.php index d7fb0708f8..bfad91a0bb 100644 --- a/CRM/Mailing/Event/DAO/Delivered.php +++ b/CRM/Mailing/Event/DAO/Delivered.php @@ -1,220 +1,6 @@ __table = 'civicrm_mailing_event_delivered'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Mailing Delivery Events') : ts('Mailing Delivery Event'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Delivered ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_delivered.id', - 'table_name' => 'civicrm_mailing_event_delivered', - 'entity' => 'Delivered', - 'bao' => 'CRM_Mailing_Event_BAO_Delivered', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'event_queue_id' => [ - 'name' => 'event_queue_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Event Queue ID'), - 'description' => ts('FK to EventQueue'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_delivered.event_queue_id', - 'table_name' => 'civicrm_mailing_event_delivered', - 'entity' => 'Delivered', - 'bao' => 'CRM_Mailing_Event_BAO_Delivered', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', - 'html' => [ - 'label' => ts("Event Queue"), - ], - 'add' => NULL, - ], - 'time_stamp' => [ - 'name' => 'time_stamp', - 'type' => CRM_Utils_Type::T_TIMESTAMP, - 'title' => ts('Timestamp'), - 'description' => ts('When this delivery event occurred.'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_delivered.time_stamp', - 'default' => 'CURRENT_TIMESTAMP', - 'table_name' => 'civicrm_mailing_event_delivered', - 'entity' => 'Delivered', - 'bao' => 'CRM_Mailing_Event_BAO_Delivered', - 'localizable' => 0, - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_delivered', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_delivered', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = []; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_Event_DAO_MailingEventDelivered', 'CRM_Mailing_Event_DAO_Delivered'); diff --git a/CRM/Mailing/Event/DAO/Forward.php b/CRM/Mailing/Event/DAO/Forward.php index 5294c57af5..2f5b1a2009 100644 --- a/CRM/Mailing/Event/DAO/Forward.php +++ b/CRM/Mailing/Event/DAO/Forward.php @@ -1,246 +1,6 @@ __table = 'civicrm_mailing_event_forward'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Mailing Forwarded Events') : ts('Mailing Forwarded Event'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'dest_queue_id', 'civicrm_mailing_event_queue', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Forward ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_forward.id', - 'table_name' => 'civicrm_mailing_event_forward', - 'entity' => 'Forward', - 'bao' => 'CRM_Mailing_Event_BAO_Forward', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'event_queue_id' => [ - 'name' => 'event_queue_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Event Queue ID'), - 'description' => ts('FK to EventQueue'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_forward.event_queue_id', - 'table_name' => 'civicrm_mailing_event_forward', - 'entity' => 'Forward', - 'bao' => 'CRM_Mailing_Event_BAO_Forward', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', - 'html' => [ - 'label' => ts("Event Queue"), - ], - 'add' => NULL, - ], - 'dest_queue_id' => [ - 'name' => 'dest_queue_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Destination Queue ID'), - 'description' => ts('FK to EventQueue for destination'), - 'where' => 'civicrm_mailing_event_forward.dest_queue_id', - 'table_name' => 'civicrm_mailing_event_forward', - 'entity' => 'Forward', - 'bao' => 'CRM_Mailing_Event_BAO_Forward', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', - 'html' => [ - 'label' => ts("Destination Queue"), - ], - 'add' => NULL, - ], - 'time_stamp' => [ - 'name' => 'time_stamp', - 'type' => CRM_Utils_Type::T_TIMESTAMP, - 'title' => ts('Timestamp'), - 'description' => ts('When this forward event occurred.'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_forward.time_stamp', - 'default' => 'CURRENT_TIMESTAMP', - 'table_name' => 'civicrm_mailing_event_forward', - 'entity' => 'Forward', - 'bao' => 'CRM_Mailing_Event_BAO_Forward', - 'localizable' => 0, - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_forward', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_forward', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = []; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_Event_DAO_MailingEventForward', 'CRM_Mailing_Event_DAO_Forward'); diff --git a/CRM/Mailing/Event/DAO/MailingEventBounce.php b/CRM/Mailing/Event/DAO/MailingEventBounce.php new file mode 100644 index 0000000000..91791bc19a --- /dev/null +++ b/CRM/Mailing/Event/DAO/MailingEventBounce.php @@ -0,0 +1,272 @@ +__table = 'civicrm_mailing_event_bounce'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Bounce Events') : ts('Mailing Bounce Event'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Bounce ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_bounce.id', + 'table_name' => 'civicrm_mailing_event_bounce', + 'entity' => 'MailingEventBounce', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventBounce', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'event_queue_id' => [ + 'name' => 'event_queue_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Event Queue ID'), + 'description' => ts('FK to EventQueue'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_bounce.event_queue_id', + 'table_name' => 'civicrm_mailing_event_bounce', + 'entity' => 'MailingEventBounce', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventBounce', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'html' => [ + 'label' => ts("Event Queue"), + ], + 'add' => NULL, + ], + 'bounce_type_id' => [ + 'name' => 'bounce_type_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Bounce Type'), + 'description' => ts('What type of bounce was it?'), + 'where' => 'civicrm_mailing_event_bounce.bounce_type_id', + 'table_name' => 'civicrm_mailing_event_bounce', + 'entity' => 'MailingEventBounce', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventBounce', + 'localizable' => 0, + 'html' => [ + 'type' => 'Select', + ], + 'pseudoconstant' => [ + 'table' => 'civicrm_mailing_bounce_type', + 'keyColumn' => 'id', + 'labelColumn' => 'name', + ], + 'add' => NULL, + ], + 'bounce_reason' => [ + 'name' => 'bounce_reason', + 'type' => CRM_Utils_Type::T_STRING, + 'title' => ts('Bounce Reason'), + 'description' => ts('The reason the email bounced.'), + 'maxlength' => 255, + 'size' => CRM_Utils_Type::HUGE, + 'where' => 'civicrm_mailing_event_bounce.bounce_reason', + 'table_name' => 'civicrm_mailing_event_bounce', + 'entity' => 'MailingEventBounce', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventBounce', + 'localizable' => 0, + 'add' => NULL, + ], + 'time_stamp' => [ + 'name' => 'time_stamp', + 'type' => CRM_Utils_Type::T_TIMESTAMP, + 'title' => ts('Timestamp'), + 'description' => ts('When this bounce event occurred.'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_bounce.time_stamp', + 'default' => 'CURRENT_TIMESTAMP', + 'table_name' => 'civicrm_mailing_event_bounce', + 'entity' => 'MailingEventBounce', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventBounce', + 'localizable' => 0, + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_bounce', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_bounce', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = []; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/Event/DAO/MailingEventClickThrough.php b/CRM/Mailing/Event/DAO/MailingEventClickThrough.php new file mode 100644 index 0000000000..470d08b0e7 --- /dev/null +++ b/CRM/Mailing/Event/DAO/MailingEventClickThrough.php @@ -0,0 +1,247 @@ +__table = 'civicrm_mailing_event_trackable_url_open'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Event Click Throughs') : ts('Mailing Event Click Through'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'trackable_url_id', 'civicrm_mailing_trackable_url', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Trackable URL Open ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_trackable_url_open.id', + 'table_name' => 'civicrm_mailing_event_trackable_url_open', + 'entity' => 'MailingEventClickThrough', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventClickThrough', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'event_queue_id' => [ + 'name' => 'event_queue_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Event Queue ID'), + 'description' => ts('FK to EventQueue'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_trackable_url_open.event_queue_id', + 'table_name' => 'civicrm_mailing_event_trackable_url_open', + 'entity' => 'MailingEventClickThrough', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventClickThrough', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'html' => [ + 'label' => ts("Event Queue"), + ], + 'add' => NULL, + ], + 'trackable_url_id' => [ + 'name' => 'trackable_url_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Trackable Url ID'), + 'description' => ts('FK to TrackableURL'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_trackable_url_open.trackable_url_id', + 'table_name' => 'civicrm_mailing_event_trackable_url_open', + 'entity' => 'MailingEventClickThrough', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventClickThrough', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_DAO_TrackableURL', + 'html' => [ + 'label' => ts("Trackable Url"), + ], + 'add' => NULL, + ], + 'time_stamp' => [ + 'name' => 'time_stamp', + 'type' => CRM_Utils_Type::T_TIMESTAMP, + 'title' => ts('Timestamp'), + 'description' => ts('When this trackable URL open occurred.'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_trackable_url_open.time_stamp', + 'default' => 'CURRENT_TIMESTAMP', + 'table_name' => 'civicrm_mailing_event_trackable_url_open', + 'entity' => 'MailingEventClickThrough', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventClickThrough', + 'localizable' => 0, + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_trackable_url_open', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_trackable_url_open', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = []; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/Event/DAO/MailingEventConfirm.php b/CRM/Mailing/Event/DAO/MailingEventConfirm.php new file mode 100644 index 0000000000..005f66af36 --- /dev/null +++ b/CRM/Mailing/Event/DAO/MailingEventConfirm.php @@ -0,0 +1,220 @@ +__table = 'civicrm_mailing_event_confirm'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Contribution Events') : ts('Mailing Confirmation Event'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_subscribe_id', 'civicrm_mailing_event_subscribe', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Mailing Confirmation ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_confirm.id', + 'table_name' => 'civicrm_mailing_event_confirm', + 'entity' => 'MailingEventConfirm', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventConfirm', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'event_subscribe_id' => [ + 'name' => 'event_subscribe_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Mailing Subscribe ID'), + 'description' => ts('FK to civicrm_mailing_event_subscribe'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_confirm.event_subscribe_id', + 'table_name' => 'civicrm_mailing_event_confirm', + 'entity' => 'MailingEventConfirm', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventConfirm', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_Event_DAO_MailingEventSubscribe', + 'html' => [ + 'label' => ts("Mailing Subscribe"), + ], + 'add' => NULL, + ], + 'time_stamp' => [ + 'name' => 'time_stamp', + 'type' => CRM_Utils_Type::T_TIMESTAMP, + 'title' => ts('Confirm Timestamp'), + 'description' => ts('When this confirmation event occurred.'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_confirm.time_stamp', + 'default' => 'CURRENT_TIMESTAMP', + 'table_name' => 'civicrm_mailing_event_confirm', + 'entity' => 'MailingEventConfirm', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventConfirm', + 'localizable' => 0, + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_confirm', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_confirm', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = []; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/Event/DAO/MailingEventDelivered.php b/CRM/Mailing/Event/DAO/MailingEventDelivered.php new file mode 100644 index 0000000000..287c88d650 --- /dev/null +++ b/CRM/Mailing/Event/DAO/MailingEventDelivered.php @@ -0,0 +1,220 @@ +__table = 'civicrm_mailing_event_delivered'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Delivery Events') : ts('Mailing Delivery Event'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Delivered ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_delivered.id', + 'table_name' => 'civicrm_mailing_event_delivered', + 'entity' => 'MailingEventDelivered', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventDelivered', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'event_queue_id' => [ + 'name' => 'event_queue_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Event Queue ID'), + 'description' => ts('FK to EventQueue'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_delivered.event_queue_id', + 'table_name' => 'civicrm_mailing_event_delivered', + 'entity' => 'MailingEventDelivered', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventDelivered', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'html' => [ + 'label' => ts("Event Queue"), + ], + 'add' => NULL, + ], + 'time_stamp' => [ + 'name' => 'time_stamp', + 'type' => CRM_Utils_Type::T_TIMESTAMP, + 'title' => ts('Timestamp'), + 'description' => ts('When this delivery event occurred.'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_delivered.time_stamp', + 'default' => 'CURRENT_TIMESTAMP', + 'table_name' => 'civicrm_mailing_event_delivered', + 'entity' => 'MailingEventDelivered', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventDelivered', + 'localizable' => 0, + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_delivered', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_delivered', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = []; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/Event/DAO/MailingEventForward.php b/CRM/Mailing/Event/DAO/MailingEventForward.php new file mode 100644 index 0000000000..36ff71cb52 --- /dev/null +++ b/CRM/Mailing/Event/DAO/MailingEventForward.php @@ -0,0 +1,246 @@ +__table = 'civicrm_mailing_event_forward'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Forwarded Events') : ts('Mailing Forwarded Event'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'dest_queue_id', 'civicrm_mailing_event_queue', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Forward ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_forward.id', + 'table_name' => 'civicrm_mailing_event_forward', + 'entity' => 'MailingEventForward', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventForward', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'event_queue_id' => [ + 'name' => 'event_queue_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Event Queue ID'), + 'description' => ts('FK to EventQueue'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_forward.event_queue_id', + 'table_name' => 'civicrm_mailing_event_forward', + 'entity' => 'MailingEventForward', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventForward', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'html' => [ + 'label' => ts("Event Queue"), + ], + 'add' => NULL, + ], + 'dest_queue_id' => [ + 'name' => 'dest_queue_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Destination Queue ID'), + 'description' => ts('FK to EventQueue for destination'), + 'where' => 'civicrm_mailing_event_forward.dest_queue_id', + 'table_name' => 'civicrm_mailing_event_forward', + 'entity' => 'MailingEventForward', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventForward', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'html' => [ + 'label' => ts("Destination Queue"), + ], + 'add' => NULL, + ], + 'time_stamp' => [ + 'name' => 'time_stamp', + 'type' => CRM_Utils_Type::T_TIMESTAMP, + 'title' => ts('Timestamp'), + 'description' => ts('When this forward event occurred.'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_forward.time_stamp', + 'default' => 'CURRENT_TIMESTAMP', + 'table_name' => 'civicrm_mailing_event_forward', + 'entity' => 'MailingEventForward', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventForward', + 'localizable' => 0, + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_forward', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_forward', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = []; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/Event/DAO/MailingEventOpened.php b/CRM/Mailing/Event/DAO/MailingEventOpened.php new file mode 100644 index 0000000000..f083eb02cf --- /dev/null +++ b/CRM/Mailing/Event/DAO/MailingEventOpened.php @@ -0,0 +1,220 @@ +__table = 'civicrm_mailing_event_opened'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Opened Events') : ts('Mailing Opened Event'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Mailing Opened ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_opened.id', + 'table_name' => 'civicrm_mailing_event_opened', + 'entity' => 'MailingEventOpened', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventOpened', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'event_queue_id' => [ + 'name' => 'event_queue_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Event Queue ID'), + 'description' => ts('FK to EventQueue'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_opened.event_queue_id', + 'table_name' => 'civicrm_mailing_event_opened', + 'entity' => 'MailingEventOpened', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventOpened', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'html' => [ + 'label' => ts("Event Queue"), + ], + 'add' => NULL, + ], + 'time_stamp' => [ + 'name' => 'time_stamp', + 'type' => CRM_Utils_Type::T_TIMESTAMP, + 'title' => ts('Timestamp'), + 'description' => ts('When this open event occurred.'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_opened.time_stamp', + 'default' => 'CURRENT_TIMESTAMP', + 'table_name' => 'civicrm_mailing_event_opened', + 'entity' => 'MailingEventOpened', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventOpened', + 'localizable' => 0, + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_opened', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_opened', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = []; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/Event/DAO/MailingEventQueue.php b/CRM/Mailing/Event/DAO/MailingEventQueue.php new file mode 100644 index 0000000000..1b53a79f81 --- /dev/null +++ b/CRM/Mailing/Event/DAO/MailingEventQueue.php @@ -0,0 +1,311 @@ +__table = 'civicrm_mailing_event_queue'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Queue Events') : ts('Mailing Queue Event'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'job_id', 'civicrm_mailing_job', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'email_id', 'civicrm_email', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'phone_id', 'civicrm_phone', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Mailing Event Queue ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_queue.id', + 'table_name' => 'civicrm_mailing_event_queue', + 'entity' => 'MailingEventQueue', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'job_id' => [ + 'name' => 'job_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Job ID'), + 'description' => ts('FK to Job'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_queue.job_id', + 'table_name' => 'civicrm_mailing_event_queue', + 'entity' => 'MailingEventQueue', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_DAO_MailingJob', + 'html' => [ + 'label' => ts("Job"), + ], + 'add' => NULL, + ], + 'email_id' => [ + 'name' => 'email_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Email ID'), + 'description' => ts('FK to Email'), + 'where' => 'civicrm_mailing_event_queue.email_id', + 'default' => NULL, + 'table_name' => 'civicrm_mailing_event_queue', + 'entity' => 'MailingEventQueue', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'localizable' => 0, + 'FKClassName' => 'CRM_Core_DAO_Email', + 'html' => [ + 'label' => ts("Email"), + ], + 'add' => NULL, + ], + 'contact_id' => [ + 'name' => 'contact_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Contact ID'), + 'description' => ts('FK to Contact'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_queue.contact_id', + 'table_name' => 'civicrm_mailing_event_queue', + 'entity' => 'MailingEventQueue', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'localizable' => 0, + 'FKClassName' => 'CRM_Contact_DAO_Contact', + 'html' => [ + 'label' => ts("Contact"), + ], + 'add' => NULL, + ], + 'hash' => [ + 'name' => 'hash', + 'type' => CRM_Utils_Type::T_STRING, + 'title' => ts('Security Hash'), + 'description' => ts('Security hash'), + 'required' => TRUE, + 'maxlength' => 255, + 'size' => CRM_Utils_Type::HUGE, + 'where' => 'civicrm_mailing_event_queue.hash', + 'table_name' => 'civicrm_mailing_event_queue', + 'entity' => 'MailingEventQueue', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'localizable' => 0, + 'add' => NULL, + ], + 'phone_id' => [ + 'name' => 'phone_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Phone ID'), + 'description' => ts('FK to Phone'), + 'where' => 'civicrm_mailing_event_queue.phone_id', + 'default' => NULL, + 'table_name' => 'civicrm_mailing_event_queue', + 'entity' => 'MailingEventQueue', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'localizable' => 0, + 'FKClassName' => 'CRM_Core_DAO_Phone', + 'html' => [ + 'label' => ts("Phone"), + ], + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_queue', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_queue', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = [ + 'index_hash' => [ + 'name' => 'index_hash', + 'field' => [ + 0 => 'hash', + ], + 'localizable' => FALSE, + 'sig' => 'civicrm_mailing_event_queue::0::hash', + ], + ]; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/Event/DAO/MailingEventReply.php b/CRM/Mailing/Event/DAO/MailingEventReply.php new file mode 100644 index 0000000000..a5edae55b8 --- /dev/null +++ b/CRM/Mailing/Event/DAO/MailingEventReply.php @@ -0,0 +1,220 @@ +__table = 'civicrm_mailing_event_reply'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Event Replies') : ts('Mailing Event Reply'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Reply ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_reply.id', + 'table_name' => 'civicrm_mailing_event_reply', + 'entity' => 'MailingEventReply', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventReply', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'event_queue_id' => [ + 'name' => 'event_queue_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Event Queue ID'), + 'description' => ts('FK to EventQueue'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_reply.event_queue_id', + 'table_name' => 'civicrm_mailing_event_reply', + 'entity' => 'MailingEventReply', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventReply', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'html' => [ + 'label' => ts("Event Queue"), + ], + 'add' => NULL, + ], + 'time_stamp' => [ + 'name' => 'time_stamp', + 'type' => CRM_Utils_Type::T_TIMESTAMP, + 'title' => ts('Reply Timestamp'), + 'description' => ts('When this reply event occurred.'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_reply.time_stamp', + 'default' => 'CURRENT_TIMESTAMP', + 'table_name' => 'civicrm_mailing_event_reply', + 'entity' => 'MailingEventReply', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventReply', + 'localizable' => 0, + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_reply', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_reply', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = []; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/Event/DAO/MailingEventSubscribe.php b/CRM/Mailing/Event/DAO/MailingEventSubscribe.php new file mode 100644 index 0000000000..8b5640501f --- /dev/null +++ b/CRM/Mailing/Event/DAO/MailingEventSubscribe.php @@ -0,0 +1,277 @@ +__table = 'civicrm_mailing_event_subscribe'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Event Subscribes') : ts('Mailing Event Subscribe'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'group_id', 'civicrm_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Mailing Subscribe ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_subscribe.id', + 'table_name' => 'civicrm_mailing_event_subscribe', + 'entity' => 'MailingEventSubscribe', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventSubscribe', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'group_id' => [ + 'name' => 'group_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Group ID'), + 'description' => ts('FK to Group'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_subscribe.group_id', + 'table_name' => 'civicrm_mailing_event_subscribe', + 'entity' => 'MailingEventSubscribe', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventSubscribe', + 'localizable' => 0, + 'FKClassName' => 'CRM_Contact_DAO_Group', + 'html' => [ + 'type' => 'Select', + 'label' => ts("Group"), + ], + 'pseudoconstant' => [ + 'table' => 'civicrm_group', + 'keyColumn' => 'id', + 'labelColumn' => 'title', + ], + 'add' => NULL, + ], + 'contact_id' => [ + 'name' => 'contact_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Contact ID'), + 'description' => ts('FK to Contact'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_subscribe.contact_id', + 'table_name' => 'civicrm_mailing_event_subscribe', + 'entity' => 'MailingEventSubscribe', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventSubscribe', + 'localizable' => 0, + 'FKClassName' => 'CRM_Contact_DAO_Contact', + 'html' => [ + 'label' => ts("Contact"), + ], + 'add' => NULL, + ], + 'hash' => [ + 'name' => 'hash', + 'type' => CRM_Utils_Type::T_STRING, + 'title' => ts('Mailing Subscribe Hash'), + 'description' => ts('Security hash'), + 'required' => TRUE, + 'maxlength' => 255, + 'size' => CRM_Utils_Type::HUGE, + 'where' => 'civicrm_mailing_event_subscribe.hash', + 'table_name' => 'civicrm_mailing_event_subscribe', + 'entity' => 'MailingEventSubscribe', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventSubscribe', + 'localizable' => 0, + 'add' => NULL, + ], + 'time_stamp' => [ + 'name' => 'time_stamp', + 'type' => CRM_Utils_Type::T_TIMESTAMP, + 'title' => ts('Mailing Subscribe Timestamp'), + 'description' => ts('When this subscription event occurred.'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_subscribe.time_stamp', + 'default' => 'CURRENT_TIMESTAMP', + 'table_name' => 'civicrm_mailing_event_subscribe', + 'entity' => 'MailingEventSubscribe', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventSubscribe', + 'localizable' => 0, + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_subscribe', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_subscribe', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = []; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/Event/DAO/MailingEventUnsubscribe.php b/CRM/Mailing/Event/DAO/MailingEventUnsubscribe.php new file mode 100644 index 0000000000..87453a4b97 --- /dev/null +++ b/CRM/Mailing/Event/DAO/MailingEventUnsubscribe.php @@ -0,0 +1,242 @@ +__table = 'civicrm_mailing_event_unsubscribe'; + parent::__construct(); + } + + /** + * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. + */ + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mailing Event Unsubscribes') : ts('Mailing Event Unsubscribe'); + } + + /** + * Returns foreign keys and entity references. + * + * @return array + * [CRM_Core_Reference_Interface] + */ + public static function getReferenceColumns() { + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); + } + return Civi::$statics[__CLASS__]['links']; + } + + /** + * Returns all the column names of this table + * + * @return array + */ + public static function &fields() { + if (!isset(Civi::$statics[__CLASS__]['fields'])) { + Civi::$statics[__CLASS__]['fields'] = [ + 'id' => [ + 'name' => 'id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Unsubscribe ID'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_unsubscribe.id', + 'table_name' => 'civicrm_mailing_event_unsubscribe', + 'entity' => 'MailingEventUnsubscribe', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventUnsubscribe', + 'localizable' => 0, + 'html' => [ + 'type' => 'Number', + ], + 'readonly' => TRUE, + 'add' => NULL, + ], + 'event_queue_id' => [ + 'name' => 'event_queue_id', + 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Event Queue ID'), + 'description' => ts('FK to EventQueue'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_unsubscribe.event_queue_id', + 'table_name' => 'civicrm_mailing_event_unsubscribe', + 'entity' => 'MailingEventUnsubscribe', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventUnsubscribe', + 'localizable' => 0, + 'FKClassName' => 'CRM_Mailing_Event_DAO_MailingEventQueue', + 'html' => [ + 'label' => ts("Event Queue"), + ], + 'add' => NULL, + ], + 'org_unsubscribe' => [ + 'name' => 'org_unsubscribe', + 'type' => CRM_Utils_Type::T_BOOLEAN, + 'title' => ts('Unsubscribe is for Organization?'), + 'description' => ts('Unsubscribe at org- or group-level'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_unsubscribe.org_unsubscribe', + 'table_name' => 'civicrm_mailing_event_unsubscribe', + 'entity' => 'MailingEventUnsubscribe', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventUnsubscribe', + 'localizable' => 0, + 'add' => NULL, + ], + 'time_stamp' => [ + 'name' => 'time_stamp', + 'type' => CRM_Utils_Type::T_TIMESTAMP, + 'title' => ts('Unsubscribe Timestamp'), + 'description' => ts('When this delivery event occurred.'), + 'required' => TRUE, + 'where' => 'civicrm_mailing_event_unsubscribe.time_stamp', + 'default' => 'CURRENT_TIMESTAMP', + 'table_name' => 'civicrm_mailing_event_unsubscribe', + 'entity' => 'MailingEventUnsubscribe', + 'bao' => 'CRM_Mailing_Event_DAO_MailingEventUnsubscribe', + 'localizable' => 0, + 'add' => NULL, + ], + ]; + CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); + } + return Civi::$statics[__CLASS__]['fields']; + } + + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function &fieldKeys() { + if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { + Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); + } + return Civi::$statics[__CLASS__]['fieldKeys']; + } + + /** + * Returns the names of this table + * + * @return string + */ + public static function getTableName() { + return self::$_tableName; + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return self::$_log; + } + + /** + * Returns the list of fields that can be imported + * + * @param bool $prefix + * + * @return array + */ + public static function &import($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_unsubscribe', $prefix, []); + return $r; + } + + /** + * Returns the list of fields that can be exported + * + * @param bool $prefix + * + * @return array + */ + public static function &export($prefix = FALSE) { + $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_unsubscribe', $prefix, []); + return $r; + } + + /** + * Returns the list of indices + * + * @param bool $localize + * + * @return array + */ + public static function indices($localize = TRUE) { + $indices = []; + return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; + } + +} diff --git a/CRM/Mailing/Event/DAO/Opened.php b/CRM/Mailing/Event/DAO/Opened.php index 1b17409c3e..3dac0864f4 100644 --- a/CRM/Mailing/Event/DAO/Opened.php +++ b/CRM/Mailing/Event/DAO/Opened.php @@ -1,220 +1,6 @@ __table = 'civicrm_mailing_event_opened'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Mailing Opened Events') : ts('Mailing Opened Event'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Mailing Opened ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_opened.id', - 'table_name' => 'civicrm_mailing_event_opened', - 'entity' => 'Opened', - 'bao' => 'CRM_Mailing_Event_BAO_Opened', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'event_queue_id' => [ - 'name' => 'event_queue_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Event Queue ID'), - 'description' => ts('FK to EventQueue'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_opened.event_queue_id', - 'table_name' => 'civicrm_mailing_event_opened', - 'entity' => 'Opened', - 'bao' => 'CRM_Mailing_Event_BAO_Opened', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', - 'html' => [ - 'label' => ts("Event Queue"), - ], - 'add' => NULL, - ], - 'time_stamp' => [ - 'name' => 'time_stamp', - 'type' => CRM_Utils_Type::T_TIMESTAMP, - 'title' => ts('Timestamp'), - 'description' => ts('When this open event occurred.'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_opened.time_stamp', - 'default' => 'CURRENT_TIMESTAMP', - 'table_name' => 'civicrm_mailing_event_opened', - 'entity' => 'Opened', - 'bao' => 'CRM_Mailing_Event_BAO_Opened', - 'localizable' => 0, - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_opened', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_opened', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = []; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_Event_DAO_MailingEventOpened', 'CRM_Mailing_Event_DAO_Opened'); diff --git a/CRM/Mailing/Event/DAO/Queue.php b/CRM/Mailing/Event/DAO/Queue.php index e2c9316970..ad8f2bbc77 100644 --- a/CRM/Mailing/Event/DAO/Queue.php +++ b/CRM/Mailing/Event/DAO/Queue.php @@ -1,311 +1,6 @@ __table = 'civicrm_mailing_event_queue'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Mailing Queue Events') : ts('Mailing Queue Event'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'job_id', 'civicrm_mailing_job', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'email_id', 'civicrm_email', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'phone_id', 'civicrm_phone', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Mailing Event Queue ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_queue.id', - 'table_name' => 'civicrm_mailing_event_queue', - 'entity' => 'MailingEventQueue', - 'bao' => 'CRM_Mailing_Event_BAO_Queue', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'job_id' => [ - 'name' => 'job_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Job ID'), - 'description' => ts('FK to Job'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_queue.job_id', - 'table_name' => 'civicrm_mailing_event_queue', - 'entity' => 'MailingEventQueue', - 'bao' => 'CRM_Mailing_Event_BAO_Queue', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_DAO_MailingJob', - 'html' => [ - 'label' => ts("Job"), - ], - 'add' => NULL, - ], - 'email_id' => [ - 'name' => 'email_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Email ID'), - 'description' => ts('FK to Email'), - 'where' => 'civicrm_mailing_event_queue.email_id', - 'default' => NULL, - 'table_name' => 'civicrm_mailing_event_queue', - 'entity' => 'MailingEventQueue', - 'bao' => 'CRM_Mailing_Event_BAO_Queue', - 'localizable' => 0, - 'FKClassName' => 'CRM_Core_DAO_Email', - 'html' => [ - 'label' => ts("Email"), - ], - 'add' => NULL, - ], - 'contact_id' => [ - 'name' => 'contact_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Contact ID'), - 'description' => ts('FK to Contact'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_queue.contact_id', - 'table_name' => 'civicrm_mailing_event_queue', - 'entity' => 'MailingEventQueue', - 'bao' => 'CRM_Mailing_Event_BAO_Queue', - 'localizable' => 0, - 'FKClassName' => 'CRM_Contact_DAO_Contact', - 'html' => [ - 'label' => ts("Contact"), - ], - 'add' => NULL, - ], - 'hash' => [ - 'name' => 'hash', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Security Hash'), - 'description' => ts('Security hash'), - 'required' => TRUE, - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - 'where' => 'civicrm_mailing_event_queue.hash', - 'table_name' => 'civicrm_mailing_event_queue', - 'entity' => 'MailingEventQueue', - 'bao' => 'CRM_Mailing_Event_BAO_Queue', - 'localizable' => 0, - 'add' => NULL, - ], - 'phone_id' => [ - 'name' => 'phone_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Phone ID'), - 'description' => ts('FK to Phone'), - 'where' => 'civicrm_mailing_event_queue.phone_id', - 'default' => NULL, - 'table_name' => 'civicrm_mailing_event_queue', - 'entity' => 'MailingEventQueue', - 'bao' => 'CRM_Mailing_Event_BAO_Queue', - 'localizable' => 0, - 'FKClassName' => 'CRM_Core_DAO_Phone', - 'html' => [ - 'label' => ts("Phone"), - ], - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_queue', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_queue', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = [ - 'index_hash' => [ - 'name' => 'index_hash', - 'field' => [ - 0 => 'hash', - ], - 'localizable' => FALSE, - 'sig' => 'civicrm_mailing_event_queue::0::hash', - ], - ]; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_Event_DAO_MailingEventQueue', 'CRM_Mailing_Event_DAO_Queue'); diff --git a/CRM/Mailing/Event/DAO/Reply.php b/CRM/Mailing/Event/DAO/Reply.php index 5543eb7331..647090078a 100644 --- a/CRM/Mailing/Event/DAO/Reply.php +++ b/CRM/Mailing/Event/DAO/Reply.php @@ -1,220 +1,6 @@ __table = 'civicrm_mailing_event_reply'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Replies') : ts('Reply'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Reply ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_reply.id', - 'table_name' => 'civicrm_mailing_event_reply', - 'entity' => 'Reply', - 'bao' => 'CRM_Mailing_Event_BAO_Reply', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'event_queue_id' => [ - 'name' => 'event_queue_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Event Queue ID'), - 'description' => ts('FK to EventQueue'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_reply.event_queue_id', - 'table_name' => 'civicrm_mailing_event_reply', - 'entity' => 'Reply', - 'bao' => 'CRM_Mailing_Event_BAO_Reply', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', - 'html' => [ - 'label' => ts("Event Queue"), - ], - 'add' => NULL, - ], - 'time_stamp' => [ - 'name' => 'time_stamp', - 'type' => CRM_Utils_Type::T_TIMESTAMP, - 'title' => ts('Reply Timestamp'), - 'description' => ts('When this reply event occurred.'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_reply.time_stamp', - 'default' => 'CURRENT_TIMESTAMP', - 'table_name' => 'civicrm_mailing_event_reply', - 'entity' => 'Reply', - 'bao' => 'CRM_Mailing_Event_BAO_Reply', - 'localizable' => 0, - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_reply', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_reply', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = []; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_Event_DAO_MailingEventReply', 'CRM_Mailing_Event_DAO_Reply'); diff --git a/CRM/Mailing/Event/DAO/Subscribe.php b/CRM/Mailing/Event/DAO/Subscribe.php index d10e4ceaa4..6e40d04182 100644 --- a/CRM/Mailing/Event/DAO/Subscribe.php +++ b/CRM/Mailing/Event/DAO/Subscribe.php @@ -1,277 +1,6 @@ __table = 'civicrm_mailing_event_subscribe'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Subscribes') : ts('Subscribe'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'group_id', 'civicrm_group', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Mailing Subscribe ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_subscribe.id', - 'table_name' => 'civicrm_mailing_event_subscribe', - 'entity' => 'Subscribe', - 'bao' => 'CRM_Mailing_Event_BAO_Subscribe', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'group_id' => [ - 'name' => 'group_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Group ID'), - 'description' => ts('FK to Group'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_subscribe.group_id', - 'table_name' => 'civicrm_mailing_event_subscribe', - 'entity' => 'Subscribe', - 'bao' => 'CRM_Mailing_Event_BAO_Subscribe', - 'localizable' => 0, - 'FKClassName' => 'CRM_Contact_DAO_Group', - 'html' => [ - 'type' => 'Select', - 'label' => ts("Group"), - ], - 'pseudoconstant' => [ - 'table' => 'civicrm_group', - 'keyColumn' => 'id', - 'labelColumn' => 'title', - ], - 'add' => NULL, - ], - 'contact_id' => [ - 'name' => 'contact_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Contact ID'), - 'description' => ts('FK to Contact'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_subscribe.contact_id', - 'table_name' => 'civicrm_mailing_event_subscribe', - 'entity' => 'Subscribe', - 'bao' => 'CRM_Mailing_Event_BAO_Subscribe', - 'localizable' => 0, - 'FKClassName' => 'CRM_Contact_DAO_Contact', - 'html' => [ - 'label' => ts("Contact"), - ], - 'add' => NULL, - ], - 'hash' => [ - 'name' => 'hash', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Mailing Subscribe Hash'), - 'description' => ts('Security hash'), - 'required' => TRUE, - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - 'where' => 'civicrm_mailing_event_subscribe.hash', - 'table_name' => 'civicrm_mailing_event_subscribe', - 'entity' => 'Subscribe', - 'bao' => 'CRM_Mailing_Event_BAO_Subscribe', - 'localizable' => 0, - 'add' => NULL, - ], - 'time_stamp' => [ - 'name' => 'time_stamp', - 'type' => CRM_Utils_Type::T_TIMESTAMP, - 'title' => ts('Mailing Subscribe Timestamp'), - 'description' => ts('When this subscription event occurred.'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_subscribe.time_stamp', - 'default' => 'CURRENT_TIMESTAMP', - 'table_name' => 'civicrm_mailing_event_subscribe', - 'entity' => 'Subscribe', - 'bao' => 'CRM_Mailing_Event_BAO_Subscribe', - 'localizable' => 0, - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_subscribe', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_subscribe', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = []; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_Event_DAO_MailingEventSubscribe', 'CRM_Mailing_Event_DAO_Subscribe'); diff --git a/CRM/Mailing/Event/DAO/TrackableURLOpen.php b/CRM/Mailing/Event/DAO/TrackableURLOpen.php index ec1c76091b..b44524d947 100644 --- a/CRM/Mailing/Event/DAO/TrackableURLOpen.php +++ b/CRM/Mailing/Event/DAO/TrackableURLOpen.php @@ -1,247 +1,6 @@ __table = 'civicrm_mailing_event_trackable_url_open'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Trackable URLOpens') : ts('Trackable URLOpen'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'trackable_url_id', 'civicrm_mailing_trackable_url', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Trackable URL Open ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_trackable_url_open.id', - 'table_name' => 'civicrm_mailing_event_trackable_url_open', - 'entity' => 'TrackableURLOpen', - 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'event_queue_id' => [ - 'name' => 'event_queue_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Event Queue ID'), - 'description' => ts('FK to EventQueue'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_trackable_url_open.event_queue_id', - 'table_name' => 'civicrm_mailing_event_trackable_url_open', - 'entity' => 'TrackableURLOpen', - 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', - 'html' => [ - 'label' => ts("Event Queue"), - ], - 'add' => NULL, - ], - 'trackable_url_id' => [ - 'name' => 'trackable_url_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Trackable Url ID'), - 'description' => ts('FK to TrackableURL'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_trackable_url_open.trackable_url_id', - 'table_name' => 'civicrm_mailing_event_trackable_url_open', - 'entity' => 'TrackableURLOpen', - 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_DAO_TrackableURL', - 'html' => [ - 'label' => ts("Trackable Url"), - ], - 'add' => NULL, - ], - 'time_stamp' => [ - 'name' => 'time_stamp', - 'type' => CRM_Utils_Type::T_TIMESTAMP, - 'title' => ts('Timestamp'), - 'description' => ts('When this trackable URL open occurred.'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_trackable_url_open.time_stamp', - 'default' => 'CURRENT_TIMESTAMP', - 'table_name' => 'civicrm_mailing_event_trackable_url_open', - 'entity' => 'TrackableURLOpen', - 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen', - 'localizable' => 0, - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_trackable_url_open', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_trackable_url_open', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = []; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_Event_DAO_MailingEventClickThrough', 'CRM_Mailing_Event_DAO_TrackableURLOpen'); diff --git a/CRM/Mailing/Event/DAO/Unsubscribe.php b/CRM/Mailing/Event/DAO/Unsubscribe.php index f557959418..e5cd857a65 100644 --- a/CRM/Mailing/Event/DAO/Unsubscribe.php +++ b/CRM/Mailing/Event/DAO/Unsubscribe.php @@ -1,242 +1,6 @@ __table = 'civicrm_mailing_event_unsubscribe'; - parent::__construct(); - } - - /** - * Returns localized title of this entity. - * - * @param bool $plural - * Whether to return the plural version of the title. - */ - public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Unsubscribes') : ts('Unsubscribe'); - } - - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - - /** - * Returns all the column names of this table - * - * @return array - */ - public static function &fields() { - if (!isset(Civi::$statics[__CLASS__]['fields'])) { - Civi::$statics[__CLASS__]['fields'] = [ - 'id' => [ - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Unsubscribe ID'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_unsubscribe.id', - 'table_name' => 'civicrm_mailing_event_unsubscribe', - 'entity' => 'Unsubscribe', - 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe', - 'localizable' => 0, - 'html' => [ - 'type' => 'Number', - ], - 'readonly' => TRUE, - 'add' => NULL, - ], - 'event_queue_id' => [ - 'name' => 'event_queue_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Event Queue ID'), - 'description' => ts('FK to EventQueue'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_unsubscribe.event_queue_id', - 'table_name' => 'civicrm_mailing_event_unsubscribe', - 'entity' => 'Unsubscribe', - 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe', - 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', - 'html' => [ - 'label' => ts("Event Queue"), - ], - 'add' => NULL, - ], - 'org_unsubscribe' => [ - 'name' => 'org_unsubscribe', - 'type' => CRM_Utils_Type::T_BOOLEAN, - 'title' => ts('Unsubscribe is for Organization?'), - 'description' => ts('Unsubscribe at org- or group-level'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_unsubscribe.org_unsubscribe', - 'table_name' => 'civicrm_mailing_event_unsubscribe', - 'entity' => 'Unsubscribe', - 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe', - 'localizable' => 0, - 'add' => NULL, - ], - 'time_stamp' => [ - 'name' => 'time_stamp', - 'type' => CRM_Utils_Type::T_TIMESTAMP, - 'title' => ts('Unsubscribe Timestamp'), - 'description' => ts('When this delivery event occurred.'), - 'required' => TRUE, - 'where' => 'civicrm_mailing_event_unsubscribe.time_stamp', - 'default' => 'CURRENT_TIMESTAMP', - 'table_name' => 'civicrm_mailing_event_unsubscribe', - 'entity' => 'Unsubscribe', - 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe', - 'localizable' => 0, - 'add' => NULL, - ], - ]; - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); - } - return Civi::$statics[__CLASS__]['fields']; - } - - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - - /** - * Returns the list of fields that can be imported - * - * @param bool $prefix - * - * @return array - */ - public static function &import($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_unsubscribe', $prefix, []); - return $r; - } - - /** - * Returns the list of fields that can be exported - * - * @param bool $prefix - * - * @return array - */ - public static function &export($prefix = FALSE) { - $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_unsubscribe', $prefix, []); - return $r; - } - - /** - * Returns the list of indices - * - * @param bool $localize - * - * @return array - */ - public static function indices($localize = TRUE) { - $indices = []; - return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; - } - -} +class_alias('CRM_Mailing_Event_DAO_MailingEventUnsubscribe', 'CRM_Mailing_Event_DAO_Unsubscribe'); diff --git a/CRM/Mailing/Form/ForwardMailing.php b/CRM/Mailing/Form/ForwardMailing.php index 416ecaf44d..b7b676487d 100644 --- a/CRM/Mailing/Form/ForwardMailing.php +++ b/CRM/Mailing/Form/ForwardMailing.php @@ -38,7 +38,7 @@ class CRM_Mailing_Form_ForwardMailing extends CRM_Core_Form { $mailing = &$q->getMailing(); if ($hash) { - $emailId = CRM_Core_DAO::getfieldValue('CRM_Mailing_Event_DAO_Queue', $hash, 'email_id', 'hash'); + $emailId = CRM_Core_DAO::getfieldValue('CRM_Mailing_Event_DAO_MailingEventQueue', $hash, 'email_id', 'hash'); $this->_fromEmail = $fromEmail = CRM_Core_DAO::getfieldValue('CRM_Core_DAO_Email', $emailId, 'email'); $this->assign('fromEmail', $fromEmail); } diff --git a/CRM/Report/Form/Mailing/Clicks.php b/CRM/Report/Form/Mailing/Clicks.php index d4cd2cec11..c7aebb173f 100644 --- a/CRM/Report/Form/Mailing/Clicks.php +++ b/CRM/Report/Form/Mailing/Clicks.php @@ -171,7 +171,7 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { ]; $this->_columns['civicrm_mailing_event_trackable_url_open'] = [ - 'dao' => 'CRM_Mailing_Event_DAO_TrackableURLOpen', + 'dao' => 'CRM_Mailing_Event_DAO_MailingEventClickThrough', 'fields' => [ 'time_stamp' => [ 'title' => ts('Click Date'), diff --git a/CRM/Report/Form/Mailing/Detail.php b/CRM/Report/Form/Mailing/Detail.php index f6902c03b7..9afed0ae97 100644 --- a/CRM/Report/Form/Mailing/Detail.php +++ b/CRM/Report/Form/Mailing/Detail.php @@ -120,11 +120,11 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { // adding dao just to have alias $this->_columns['civicrm_mailing_event_bounce'] = [ - 'dao' => 'CRM_Mailing_Event_DAO_Bounce', + 'dao' => 'CRM_Mailing_Event_DAO_MailingEventBounce', ]; $this->_columns['civicrm_mailing_event_delivered'] = [ - 'dao' => 'CRM_Mailing_Event_DAO_Delivered', + 'dao' => 'CRM_Mailing_Event_DAO_MailingEventDelivered', 'fields' => [ 'delivery_id' => [ 'name' => 'id', @@ -149,7 +149,7 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { ]; $this->_columns['civicrm_mailing_event_unsubscribe'] = [ - 'dao' => 'CRM_Mailing_Event_DAO_Unsubscribe', + 'dao' => 'CRM_Mailing_Event_DAO_MailingEventUnsubscribe', 'fields' => [ 'unsubscribe_id' => [ 'name' => 'id', @@ -192,7 +192,7 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { ]; $this->_columns['civicrm_mailing_event_reply'] = [ - 'dao' => 'CRM_Mailing_Event_DAO_Reply', + 'dao' => 'CRM_Mailing_Event_DAO_MailingEventReply', 'fields' => [ 'reply_id' => [ 'name' => 'id', @@ -217,7 +217,7 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { ]; $this->_columns['civicrm_mailing_event_forward'] = [ - 'dao' => 'CRM_Mailing_Event_DAO_Forward', + 'dao' => 'CRM_Mailing_Event_DAO_MailingEventForward', 'fields' => [ 'forward_id' => [ 'name' => 'id', diff --git a/CRM/Report/Form/Mailing/Opened.php b/CRM/Report/Form/Mailing/Opened.php index 4f5b76d655..5d6c5151f7 100644 --- a/CRM/Report/Form/Mailing/Opened.php +++ b/CRM/Report/Form/Mailing/Opened.php @@ -152,7 +152,7 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { ]; $this->_columns['civicrm_mailing_event_opened'] = [ - 'dao' => 'CRM_Mailing_Event_DAO_Opened', + 'dao' => 'CRM_Mailing_Event_DAO_MailingEventOpened', 'fields' => [ 'id' => [ 'required' => TRUE, diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index 603fa3adfc..6b0376cf71 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -201,7 +201,7 @@ class CRM_Utils_VersionCheck { 'CRM_Member_DAO_MembershipBlock' => 'is_active = 1', 'CRM_Pledge_DAO_Pledge' => 'is_test = 0', 'CRM_Pledge_DAO_PledgeBlock' => NULL, - 'CRM_Mailing_Event_DAO_Delivered' => NULL, + 'CRM_Mailing_Event_DAO_MailingEventDelivered' => NULL, ]; foreach ($tables as $daoName => $where) { if (class_exists($daoName)) { diff --git a/api/v3/Mailing.php b/api/v3/Mailing.php index 90f23c928f..8b5d6eb67f 100644 --- a/api/v3/Mailing.php +++ b/api/v3/Mailing.php @@ -471,7 +471,7 @@ function _civicrm_api3_mailing_event_forward_spec(&$params) { */ function civicrm_api3_mailing_event_click($params) { civicrm_api3_verify_mandatory($params, - 'CRM_Mailing_Event_DAO_TrackableURLOpen', + 'CRM_Mailing_Event_DAO_MailingEventClickThrough', ['event_queue_id', 'url_id'], FALSE ); @@ -498,7 +498,7 @@ function civicrm_api3_mailing_event_click($params) { function civicrm_api3_mailing_event_open($params) { civicrm_api3_verify_mandatory($params, - 'CRM_Mailing_Event_DAO_Opened', + 'CRM_Mailing_Event_DAO_MailingEventOpened', ['event_queue_id'], FALSE ); diff --git a/api/v3/utils.php b/api/v3/utils.php index 648defa7e1..5b6688d3f8 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -311,15 +311,6 @@ function _civicrm_api3_get_DAO($name) { // hack to deal with incorrectly named BAO/DAO - see CRM-10859 - // FIXME: DAO should be renamed CRM_Mailing_DAO_MailingEventQueue - if ($name === 'MailingEventQueue') { - return 'CRM_Mailing_Event_DAO_Queue'; - } - // FIXME: DAO should be renamed CRM_Mailing_DAO_MailingRecipients - // but am not confident mailing_recipients is tested so have not tackled. - if ($name === 'MailingRecipients') { - return 'CRM_Mailing_DAO_Recipients'; - } if ($name === 'AclRole' || $name === 'ACLRole') { return 'CRM_ACL_DAO_ACLEntityRole'; } diff --git a/ext/flexmailer/src/FlexMailerTask.php b/ext/flexmailer/src/FlexMailerTask.php index 92f9a01a32..5b17485784 100644 --- a/ext/flexmailer/src/FlexMailerTask.php +++ b/ext/flexmailer/src/FlexMailerTask.php @@ -28,7 +28,7 @@ class FlexMailerTask { /** * @var int * A persistent record for this email delivery. - * @see \CRM_Mailing_Event_DAO_Queue + * @see \CRM_Mailing_Event_DAO_MailingEventQueue */ private $eventQueueId; @@ -87,7 +87,7 @@ class FlexMailerTask { /** * @return int - * @see \CRM_Mailing_Event_DAO_Queue + * @see \CRM_Mailing_Event_DAO_MailingEventQueue */ public function getEventQueueId() { return $this->eventQueueId; diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index 29f75600b1..357ce2f2e1 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -869,13 +869,13 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'sample' => 'Scheduled', ], ], - 'CRM_Mailing_Event_DAO_Bounce' => [ + 'CRM_Mailing_Event_DAO_MailingEventBounce' => [ [ 'fieldName' => 'bounce_type_id', 'sample' => 'Invalid', ], ], - 'CRM_Mailing_Event_DAO_Subscribe' => [ + 'CRM_Mailing_Event_DAO_MailingEventSubscribe' => [ [ 'fieldName' => 'group_id', 'sample' => $group_name, diff --git a/tests/phpunit/api/v3/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index e0c6f33d8f..bac803fc07 100644 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -749,8 +749,8 @@ class api_v3_MailingTest extends CiviUnitTestCase { //CRM-20431 - Delete group id that matches first mailing id. $this->callAPISuccess('Group', 'delete', ['id' => $this->_groupID]); $jobId = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_MailingJob', $mail2['id'], 'id', 'mailing_id'); - $hash = CRM_Core_DAO::getFieldValue('CRM_Mailing_Event_DAO_Queue', $jobId, 'hash', 'job_id'); - $queueId = CRM_Core_DAO::getFieldValue('CRM_Mailing_Event_DAO_Queue', $jobId, 'id', 'job_id'); + $hash = CRM_Core_DAO::getFieldValue('CRM_Mailing_Event_DAO_MailingEventQueue', $jobId, 'hash', 'job_id'); + $queueId = CRM_Core_DAO::getFieldValue('CRM_Mailing_Event_DAO_MailingEventQueue', $jobId, 'id', 'job_id'); // This gets the list of groups to unsubscribe but does NOT actually unsubcribe from groups (because return=TRUE) $beforeUnsubscribeGroups = CRM_Mailing_Event_BAO_Unsubscribe::unsub_from_mailing($jobId, $queueId, $hash, TRUE); // Assert that there are two groups in the unsubscribe list. diff --git a/xml/schema/Mailing/Event/Bounce.xml b/xml/schema/Mailing/Event/MailingEventBounce.xml similarity index 98% rename from xml/schema/Mailing/Event/Bounce.xml rename to xml/schema/Mailing/Event/MailingEventBounce.xml index 6677222391..f71cd47953 100644 --- a/xml/schema/Mailing/Event/Bounce.xml +++ b/xml/schema/Mailing/Event/MailingEventBounce.xml @@ -2,7 +2,7 @@ CRM/Mailing/Event - Bounce + MailingEventBouncecivicrm_mailing_event_bounceTracks when and why an email bounced.true diff --git a/xml/schema/Mailing/Event/TrackableURLOpen.xml b/xml/schema/Mailing/Event/MailingEventClickThrough.xml similarity index 97% rename from xml/schema/Mailing/Event/TrackableURLOpen.xml rename to xml/schema/Mailing/Event/MailingEventClickThrough.xml index 3fef9d75e9..54721f4f96 100644 --- a/xml/schema/Mailing/Event/TrackableURLOpen.xml +++ b/xml/schema/Mailing/Event/MailingEventClickThrough.xml @@ -2,7 +2,7 @@
CRM/Mailing/Event - TrackableURLOpen + MailingEventClickThroughcivicrm_mailing_event_trackable_url_openTracks when a TrackableURL is clicked by a recipient.true diff --git a/xml/schema/Mailing/Event/Confirm.xml b/xml/schema/Mailing/Event/MailingEventConfirm.xml similarity index 97% rename from xml/schema/Mailing/Event/Confirm.xml rename to xml/schema/Mailing/Event/MailingEventConfirm.xml index 51c5b37b92..7e12d7eee3 100644 --- a/xml/schema/Mailing/Event/Confirm.xml +++ b/xml/schema/Mailing/Event/MailingEventConfirm.xml @@ -2,7 +2,7 @@
CRM/Mailing/Event - Confirm + MailingEventConfirmcivicrm_mailing_event_confirmTracks when a subscription event is confirmed by emailtrue diff --git a/xml/schema/Mailing/Event/Delivered.xml b/xml/schema/Mailing/Event/MailingEventDelivered.xml similarity index 97% rename from xml/schema/Mailing/Event/Delivered.xml rename to xml/schema/Mailing/Event/MailingEventDelivered.xml index 17d676dfaa..9993110d8d 100644 --- a/xml/schema/Mailing/Event/Delivered.xml +++ b/xml/schema/Mailing/Event/MailingEventDelivered.xml @@ -2,7 +2,7 @@
CRM/Mailing/Event - Delivered + MailingEventDeliveredcivicrm_mailing_event_deliveredTracks when a queued email is actually delivered to the MTAtrue diff --git a/xml/schema/Mailing/Event/Forward.xml b/xml/schema/Mailing/Event/MailingEventForward.xml similarity index 97% rename from xml/schema/Mailing/Event/Forward.xml rename to xml/schema/Mailing/Event/MailingEventForward.xml index 7198f96ddf..6afbd4b956 100644 --- a/xml/schema/Mailing/Event/Forward.xml +++ b/xml/schema/Mailing/Event/MailingEventForward.xml @@ -2,7 +2,7 @@
CRM/Mailing/Event - Forward + MailingEventForwardcivicrm_mailing_event_forwardTracks when a contact forwards a mailing to a (new) contacttrue diff --git a/xml/schema/Mailing/Event/Opened.xml b/xml/schema/Mailing/Event/MailingEventOpened.xml similarity index 97% rename from xml/schema/Mailing/Event/Opened.xml rename to xml/schema/Mailing/Event/MailingEventOpened.xml index 6b71ab226b..96b722c84b 100644 --- a/xml/schema/Mailing/Event/Opened.xml +++ b/xml/schema/Mailing/Event/MailingEventOpened.xml @@ -2,7 +2,7 @@
CRM/Mailing/Event - Opened + MailingEventOpenedcivicrm_mailing_event_openedTracks when a delivered email is opened by the recipienttrue diff --git a/xml/schema/Mailing/Event/Queue.xml b/xml/schema/Mailing/Event/MailingEventQueue.xml similarity index 98% rename from xml/schema/Mailing/Event/Queue.xml rename to xml/schema/Mailing/Event/MailingEventQueue.xml index 491eddaa75..762cca8cca 100644 --- a/xml/schema/Mailing/Event/Queue.xml +++ b/xml/schema/Mailing/Event/MailingEventQueue.xml @@ -2,7 +2,7 @@
CRM/Mailing/Event - Queue + MailingEventQueueMailingEventQueuecivicrm_mailing_event_queueA collection of all intended recipients of a job diff --git a/xml/schema/Mailing/Event/Reply.xml b/xml/schema/Mailing/Event/MailingEventReply.xml similarity index 97% rename from xml/schema/Mailing/Event/Reply.xml rename to xml/schema/Mailing/Event/MailingEventReply.xml index 4f5d801999..fac5cce5c4 100644 --- a/xml/schema/Mailing/Event/Reply.xml +++ b/xml/schema/Mailing/Event/MailingEventReply.xml @@ -2,7 +2,7 @@
CRM/Mailing/Event - Reply + MailingEventReplycivicrm_mailing_event_replyTracks when a contact replies to a mailingtrue diff --git a/xml/schema/Mailing/Event/Subscribe.xml b/xml/schema/Mailing/Event/MailingEventSubscribe.xml similarity index 98% rename from xml/schema/Mailing/Event/Subscribe.xml rename to xml/schema/Mailing/Event/MailingEventSubscribe.xml index 52f17b30af..80422205be 100644 --- a/xml/schema/Mailing/Event/Subscribe.xml +++ b/xml/schema/Mailing/Event/MailingEventSubscribe.xml @@ -2,7 +2,7 @@
CRM/Mailing/Event - Subscribe + MailingEventSubscribecivicrm_mailing_event_subscribeTracks when a (new) contact subscribes to a group by emailtrue diff --git a/xml/schema/Mailing/Event/Unsubscribe.xml b/xml/schema/Mailing/Event/MailingEventUnsubscribe.xml similarity index 97% rename from xml/schema/Mailing/Event/Unsubscribe.xml rename to xml/schema/Mailing/Event/MailingEventUnsubscribe.xml index a4f10f0105..3b0d3215af 100644 --- a/xml/schema/Mailing/Event/Unsubscribe.xml +++ b/xml/schema/Mailing/Event/MailingEventUnsubscribe.xml @@ -2,7 +2,7 @@
CRM/Mailing/Event - Unsubscribe + MailingEventUnsubscribecivicrm_mailing_event_unsubscribeTracks when a recipient unsubscribes from a group/domaintrue diff --git a/xml/schema/Mailing/Event/files.xml b/xml/schema/Mailing/Event/files.xml index 6d82160452..eac25940e0 100644 --- a/xml/schema/Mailing/Event/files.xml +++ b/xml/schema/Mailing/Event/files.xml @@ -2,15 +2,15 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/xml/schema/Mailing/Component.xml b/xml/schema/Mailing/MailingComponent.xml similarity index 100% rename from xml/schema/Mailing/Component.xml rename to xml/schema/Mailing/MailingComponent.xml diff --git a/xml/schema/Mailing/Recipients.xml b/xml/schema/Mailing/MailingRecipients.xml similarity index 94% rename from xml/schema/Mailing/Recipients.xml rename to xml/schema/Mailing/MailingRecipients.xml index 4585b66524..12bb2e988a 100644 --- a/xml/schema/Mailing/Recipients.xml +++ b/xml/schema/Mailing/MailingRecipients.xml @@ -2,13 +2,13 @@
CRM/Mailing - Recipients + MailingRecipientscivicrm_mailing_recipientsStores information about the recipients of a mailing.trueCiviMail - Recipient - Recipients + Mailing Recipient + Mailing Recipients id Mailing Recipients ID diff --git a/xml/schema/Mailing/files.xml b/xml/schema/Mailing/files.xml index 22a924c9ba..00c885a810 100644 --- a/xml/schema/Mailing/files.xml +++ b/xml/schema/Mailing/files.xml @@ -2,13 +2,13 @@ - + - + -- 2.25.1