diff --git a/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php b/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php index 3596f7c55..a80922a7d 100644 --- a/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php +++ b/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php @@ -10,7 +10,6 @@ final class Ebizmarts_MailChimp_Model_ProcessWebhook { * @used-by Aoe_Scheduler_Model_Observer::dispatch() (app/code/community/Ebizmarts/MailChimp/etc/config.xml) */ function __construct() { - $this->_helper = hcg_mc_h(); $this->_dateHelper = Mage::helper('mailchimp/date'); $this->_tags = new Tags; $this->_interestGroupHandle = Mage::getModel('mailchimp/api_subscribers_InterestGroupHandle'); @@ -22,7 +21,7 @@ function __construct() { * @used-by Aoe_Scheduler_Model_Observer::dispatch() (app/code/community/Ebizmarts/MailChimp/etc/config.xml) */ function deleteProcessed():void { - $helper = $this->getHelper(); + $helper = hcg_mc_h(); $resource = $helper->getCoreResource(); $connection = $resource->getConnection('core_write'); $tableName = $resource->getTableName('mailchimp/webhookrequest'); @@ -41,7 +40,7 @@ function processWebhookData():void { $collection->getSelect()->limit(self::BATCH_LIMIT); foreach ($collection as $webhookRequest) { - $data = $this->_helper->unserialize($webhookRequest->getDataRequest()); + $data = hcg_mc_h()->unserialize($webhookRequest->getDataRequest()); if ($data) { switch ($webhookRequest->getType()) { @@ -78,7 +77,7 @@ private function _saveProcessedWebhook($webhookRequest):void {$webhookRequest->s * @return void */ private function _updateEmail(array $data):void { - $helper = $this->getHelper(); + $helper = hcg_mc_h(); $listId = $data['list_id']; $old = $data['old_email']; $new = $data['new_email']; @@ -107,7 +106,7 @@ private function _updateEmail(array $data):void { */ private function _clean(array $data):void { //Delete subscriber from Magento - $helper = $this->getHelper(); + $helper = hcg_mc_h(); $s = $helper->loadListSubscriber($data['list_id'], $data['email']); if ($s && $s->getId()) { @@ -141,7 +140,7 @@ private function _subscribe(array $data):void { * @return void */ private function _unsubscribe(array $data):void { - $helper = $this->getHelper(); + $helper = hcg_mc_h(); $subscriber = $helper->loadListSubscriber($data['list_id'], $data['email']); if ($subscriber && $subscriber->getId()) { try { @@ -201,14 +200,6 @@ private function getInterestGroupHandleModel() */ private function getMailchimpTagsModel():Tags {return $this->_tags;} - /** - * @return Ebizmarts_MailChimp_Helper_Data - */ - private function getHelper($type='') - { - return $this->_helper; - } - /** * @return Ebizmarts_MailChimp_Helper_Date|Mage_Core_Helper_Abstract */ @@ -219,10 +210,6 @@ private function getDateHelper() const BATCH_LIMIT = 200; - /** - * @var Ebizmarts_MailChimp_Helper_Data - */ - private $_helper; private $_dateHelper; /** diff --git a/app/code/local/HCG/MailChimp/lib/h/main.php b/app/code/local/HCG/MailChimp/lib/h/main.php index b402bb6eb..92af317c7 100644 --- a/app/code/local/HCG/MailChimp/lib/h/main.php +++ b/app/code/local/HCG/MailChimp/lib/h/main.php @@ -62,6 +62,11 @@ * @used-by Ebizmarts_MailChimp_Model_ClearEcommerce::__construct() * @used-by Ebizmarts_MailChimp_Model_Cron::__construct() * @used-by Ebizmarts_MailChimp_Model_Observer::makeHelper() + * @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::_clean() + * @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::_unsubscribe() + * @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::_updateEmail() + * @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::deleteProcessed() + * @used-by Ebizmarts_MailChimp_Model_ProcessWebhook::processWebhookData() * @used-by Ebizmarts_MailChimp_Model_System_Config_Backend_Active::makeHelper() * @used-by Ebizmarts_MailChimp_Model_System_Config_Backend_Apikey::makeHelper() * @used-by Ebizmarts_MailChimp_Model_System_Config_Backend_Ecommerce::makeHelper()