From b9eecb3bb02b4303ce9508cf47866814a3effeac Mon Sep 17 00:00:00 2001 From: gonzalo Date: Sat, 18 Mar 2017 00:10:54 -0300 Subject: [PATCH] closes #4 --- Helper/Data.php | 15 +++++++-------- composer.json | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Helper/Data.php b/Helper/Data.php index 32ec42b4..77151669 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -90,9 +90,9 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper */ private $_mailChimpSyncEcommerce; /** - * @var \Magento\Catalog\Model\ResourceModel\Product\Collection + * @var \Ebizmarts\MailChimp\Model\MailChimpSyncEcommerce */ - private $_productCollection; + private $_mailChimpSyncE; /** * Data constructor. @@ -106,7 +106,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper * @param \Magento\Customer\Model\ResourceModel\CustomerRepository $customer * @param \Ebizmarts\MailChimp\Model\MailChimpErrors $mailChimpErrors * @param \Ebizmarts\MailChimp\Model\MailChimpSyncEcommerceFactory $mailChimpSyncEcommerce - * @param \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection + * @param \Ebizmarts\MailChimp\Model\MailChimpSyncEcommerce $mailChimpSyncE */ public function __construct( \Magento\Framework\App\Helper\Context $context, @@ -119,7 +119,7 @@ public function __construct( \Magento\Customer\Model\ResourceModel\CustomerRepository $customer, \Ebizmarts\MailChimp\Model\MailChimpErrors $mailChimpErrors, \Ebizmarts\MailChimp\Model\MailChimpSyncEcommerceFactory $mailChimpSyncEcommerce, - \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection + \Ebizmarts\MailChimp\Model\MailChimpSyncEcommerce $mailChimpSyncE ) { $this->_storeManager = $storeManager; @@ -133,7 +133,7 @@ public function __construct( $this->_customer = $customer; $this->_mailChimpErrors = $mailChimpErrors; $this->_mailChimpSyncEcommerce = $mailChimpSyncEcommerce; - $this->_productCollection = $productCollection; + $this->_mailChimpSyncE = $mailChimpSyncE; parent::__construct($context); } @@ -474,10 +474,9 @@ public function resetErrors() $tableName = $this->_mailChimpErrors->getResource()->getMainTable(); $connection->truncateTable($tableName); // clean the syncecommerce table with errors - $connection = $this->_mailChimpSyncEcommerce->getResource()->getConnection(); - $tableName = $this->_mailChimpSyncEcommerce->getResource()->getMainTable(); + $connection = $this->_mailChimpSyncE->getResource()->getConnection(); + $tableName = $this->_mailChimpSyncE->getResource()->getMainTable(); $connection->truncateTable($tableName); - // clean the error in eav for customers } catch(\Zend_Db_Exception $e) { throw new ValidatorException(__($e->getMessage())); } diff --git a/composer.json b/composer.json index f1e75712..6135cd5e 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ }, "description": "Connect MailChimp with Magento", "type": "magento2-module", - "version": "1.0.2", + "version": "1.0.3", "authors": [ { "name": "Ebizmarts Corp",