From 78b074514cdc225388cbbe78da829e24022d7b5a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Thu, 2 May 2024 21:02:05 +0100 Subject: [PATCH] https://github.com/thehcginstitute-com/m1/issues/590 --- .../MailChimp/Model/ProcessWebhook.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php b/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php index b34cbd7dd..fb27a424b 100644 --- a/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php +++ b/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php @@ -17,6 +17,15 @@ function __construct() { $this->_interestGroupHandle = Mage::getModel('mailchimp/api_subscribers_InterestGroupHandle'); } + function deleteProcessed():void { + $helper = $this->getHelper(); + $resource = $helper->getCoreResource(); + $connection = $resource->getConnection('core_write'); + $tableName = $resource->getTableName('mailchimp/webhookrequest'); + $where = array("fired_at < NOW() - INTERVAL 30 DAY AND processed = 1"); + $connection->delete($tableName, $where); + } + /** * 2024-05-02 Dmitrii Fediuk https://upwork.com/fl/mage2pro * "Refactor `Ebizmarts_MailChimp_Model_ProcessWebhook`": https://github.com/cabinetsbay/site/issues/590 @@ -167,15 +176,6 @@ private function _unsubscribe(array $data):void { */ function _profile(array $data):void {$this->getMailchimpTagsModel()->processMergeFields($data);} - function deleteProcessed():void { - $helper = $this->getHelper(); - $resource = $helper->getCoreResource(); - $connection = $resource->getConnection('core_write'); - $tableName = $resource->getTableName('mailchimp/webhookrequest'); - $where = array("fired_at < NOW() - INTERVAL 30 DAY AND processed = 1"); - $connection->delete($tableName, $where); - } - private function _getStoreId() { return Mage::app()->getStore()->getId();