Deprecations for Mailing::delete functions
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 28 Feb 2023 21:01:23 +0000 (10:01 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 28 Feb 2023 21:01:38 +0000 (10:01 +1300)
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/BAO/MailingAB.php
CRM/Mailing/BAO/MailingJob.php
CRM/Mailing/Form/Approve.php
CRM/Mailing/Form/Browse.php
CRM/Mailing/Page/Browse.php

index e772bac2701acd2682b2f4e39053d14bf782616d..2ca7e67f9c0747634b7955a203f93b813d750bde 100644 (file)
@@ -2405,6 +2405,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
    * @deprecated
    */
   public static function del($id) {
+    CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
     static::deleteRecord(['id' => $id]);
   }
 
@@ -2436,7 +2437,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
 
     CRM_Core_Error::deprecatedWarning('This function is deprecated, use CRM_Mailing_BAO_MailingJob::del instead');
 
-    CRM_Mailing_BAO_MailingJob::del($id);
+    CRM_Mailing_BAO_MailingJob::deleteRecord(['id' => $id]);
   }
 
   /**
index 73ce87482176132855e9333ee5c9c847fe05acfe..681f90d4ce712ba837d06cb368b171ba9efaa9b9 100644 (file)
@@ -52,6 +52,7 @@ class CRM_Mailing_BAO_MailingAB extends CRM_Mailing_DAO_MailingAB implements \Ci
    * @deprecated
    */
   public static function del($id) {
+    CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
     static::deleteRecord(['id' => $id]);
   }
 
index 2522030c6a30ba254f1f2de2d5457b477d566d8d..d8de39f04ca23a2fab5fc06d1f9721b236a2dacc 100644 (file)
@@ -1102,6 +1102,7 @@ AND    record_type_id = $targetRecordID
    * @return bool
    */
   public static function del($id) {
+    CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
     return (bool) self::deleteRecord(['id' => $id]);
   }
 
index 1cd4140b037a38eda4af09fe6d96abf055f5a75b..a777d4f5b00c4f1dd28935bbc6ddc5581800f758 100644 (file)
@@ -155,7 +155,7 @@ class CRM_Mailing_Form_Approve extends CRM_Core_Form {
       $job = new CRM_Mailing_BAO_MailingJob();
       $job->mailing_id = $params['id'];
       while ($job->fetch()) {
-        CRM_Mailing_BAO_MailingJob::del($job->id);
+        CRM_Mailing_BAO_MailingJob::deleteRecord(['id' => $job->id]);
       }
     }
     else {
index 9b221b4de85cc7f9ac06539d01172c114fc575b9..a8936bdd951142b2421cd72ae8e5bd6c7f661a46 100644 (file)
@@ -61,7 +61,7 @@ class CRM_Mailing_Form_Browse extends CRM_Core_Form {
 
   public function postProcess() {
     if ($this->_action & CRM_Core_Action::DELETE) {
-      CRM_Mailing_BAO_Mailing::del($this->_mailingId);
+      CRM_Mailing_BAO_Mailing::deleteRecord(['id' => $this->_mailingId]);
       CRM_Core_Session::setStatus(ts('Selected mailing has been deleted.'), ts('Deleted'), 'success');
     }
     elseif ($this->_action & CRM_Core_Action::DISABLE) {
index ff8fde09ee2c46986f456c883a44335760da67bd..501e56e1736fbf2cca3a7e77e7244a3d9ff47cd4 100644 (file)
@@ -199,7 +199,7 @@ class CRM_Mailing_Page_Browse extends CRM_Core_Page {
           CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
         }
 
-        CRM_Mailing_BAO_Mailing::del($this->_mailingId);
+        CRM_Mailing_BAO_Mailing::deleteRecord(['id' => $this->_mailingId]);
         CRM_Core_Session::setStatus(ts('Selected mailing has been deleted.'), ts('Deleted'), 'success');
         CRM_Utils_System::redirect($context);
       }