From: Eileen McNaughton Date: Tue, 28 Feb 2023 21:01:23 +0000 (+1300) Subject: Deprecations for Mailing::delete functions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=05a3f57c4bdd286a0c4c93c2583e9fece834f30f;p=civicrm-core.git Deprecations for Mailing::delete functions --- diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index e772bac270..2ca7e67f9c 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -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]); } /** diff --git a/CRM/Mailing/BAO/MailingAB.php b/CRM/Mailing/BAO/MailingAB.php index 73ce874821..681f90d4ce 100644 --- a/CRM/Mailing/BAO/MailingAB.php +++ b/CRM/Mailing/BAO/MailingAB.php @@ -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]); } diff --git a/CRM/Mailing/BAO/MailingJob.php b/CRM/Mailing/BAO/MailingJob.php index 2522030c6a..d8de39f04c 100644 --- a/CRM/Mailing/BAO/MailingJob.php +++ b/CRM/Mailing/BAO/MailingJob.php @@ -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]); } diff --git a/CRM/Mailing/Form/Approve.php b/CRM/Mailing/Form/Approve.php index 1cd4140b03..a777d4f5b0 100644 --- a/CRM/Mailing/Form/Approve.php +++ b/CRM/Mailing/Form/Approve.php @@ -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 { diff --git a/CRM/Mailing/Form/Browse.php b/CRM/Mailing/Form/Browse.php index 9b221b4de8..a8936bdd95 100644 --- a/CRM/Mailing/Form/Browse.php +++ b/CRM/Mailing/Form/Browse.php @@ -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) { diff --git a/CRM/Mailing/Page/Browse.php b/CRM/Mailing/Page/Browse.php index ff8fde09ee..501e56e173 100644 --- a/CRM/Mailing/Page/Browse.php +++ b/CRM/Mailing/Page/Browse.php @@ -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); }