Contiamo_Connector - Version 1.2.0

Version Notes

Minor:
- return order update count from status endpoint

Download this release

Release Info

Developer Chris Baynes
Extension Contiamo_Connector
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.2 to 1.2.0

app/code/community/Contiamo/Connector/Model/Export/Status.php CHANGED
@@ -2,16 +2,17 @@
2
 
3
  class Contiamo_Connector_Model_Export_Status
4
  {
5
- protected $_orders, $_orderItems, $_customers;
6
 
7
  public function export()
8
  {
9
  $data = array(
10
- 'order_count' => $this->_orders->getSize(),
11
- 'order_items_count' => $this->_orderItems->getSize(),
12
- 'customer_count' => $this->_customers->getSize(),
13
- 'version' => Mage::helper('contiamo')->getVersion(),
14
- 'mage_version' => Mage::getVersion()
 
15
  );
16
 
17
  $header = array_keys($data);
@@ -22,22 +23,23 @@ class Contiamo_Connector_Model_Export_Status
22
 
23
  public function init($dateFrom)
24
  {
25
- $this->_orders = Mage::getModel('sales/order')->getCollection();
26
- $this->_orderItems = Mage::getModel('sales/order_item')->getCollection();
27
- $this->_customers = Mage::getModel('customer/customer')->getCollection();
 
 
 
 
 
 
28
 
29
- // date should have the format: yyyy-mm-dd
30
- if ($dateFrom) $this->_setDateFilter($dateFrom);
31
 
32
  return $this;
33
  }
34
 
35
- private function _setDateFilter($dateFrom)
36
  {
37
- $collections = array($this->_orders, $this->_orderItems, $this->_customers);
38
-
39
- foreach ($collections as $collection) {
40
- $collection->addAttributeToFilter('created_at', array('from' => $dateFrom, 'date' => true));
41
- }
42
  }
43
  }
2
 
3
  class Contiamo_Connector_Model_Export_Status
4
  {
5
+ protected $_orders, $_orderUpdates, $_orderItems, $_customers;
6
 
7
  public function export()
8
  {
9
  $data = array(
10
+ 'order_count' => $this->_orders->getSize(),
11
+ 'order_updates_count' => $this->_orderUpdates->getSize(),
12
+ 'order_items_count' => $this->_orderItems->getSize(),
13
+ 'customer_count' => $this->_customers->getSize(),
14
+ 'version' => Mage::helper('contiamo')->getVersion(),
15
+ 'mage_version' => Mage::getVersion()
16
  );
17
 
18
  $header = array_keys($data);
23
 
24
  public function init($dateFrom)
25
  {
26
+ $this->_orders = Mage::getModel('sales/order')->getCollection();
27
+ $this->_orderUpdates = Mage::getModel('sales/order')->getCollection();
28
+ $this->_orderItems = Mage::getModel('sales/order_item')->getCollection();
29
+ $this->_customers = Mage::getModel('customer/customer')->getCollection();
30
+
31
+ $createdAtCollections = array($this->_orders, $this->_orderItems, $this->_customers);
32
+ foreach ($createdAtCollections as $coll) {
33
+ $this->_setDateFilter($coll, 'created_at', $dateFrom);
34
+ }
35
 
36
+ $this->_setDateFilter($this->_orderUpdates, 'updated_at', $dateFrom);
 
37
 
38
  return $this;
39
  }
40
 
41
+ private function _setDateFilter($collection, $dateField, $dateFrom)
42
  {
43
+ $collection->addAttributeToFilter($dateField, array('from' => $dateFrom, 'date' => true));
 
 
 
 
44
  }
45
  }
app/code/community/Contiamo/Connector/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Contiamo_Connector>
5
- <version>1.1.2</version>
6
  </Contiamo_Connector>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Contiamo_Connector>
5
+ <version>1.2.0</version>
6
  </Contiamo_Connector>
7
  </modules>
8
 
package.xml CHANGED
@@ -1,21 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Contiamo_Connector</name>
4
- <version>1.1.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Use Contiamo to analyze your sale trends and customer base.</summary>
10
  <description>Use Contiamo to analyze your sale trends and customer base.</description>
11
- <notes>Minor: &#xD;
12
- - add coupon rule name to order export&#xD;
13
- - add magento version to status&#xD;
14
- </notes>
15
  <authors><author><name>Chris Baynes</name><user>contiamo</user><email>info@contiamo.com</email></author></authors>
16
- <date>2015-06-16</date>
17
- <time>15:22:40</time>
18
- <contents><target name="magecommunity"><dir name="Contiamo"><dir name="Connector"><dir name="Helper"><file name="Data.php" hash="0b7005dfbd871a92c54f5a66201cde27"/></dir><dir name="Model"><dir name="Admin"><file name="AbstractSource.php" hash="649e273afe1ed9833eaa93c3c9dd9ce0"/><file name="CustomerSource.php" hash="832645ffd3dfc57e0d98ad83325ece02"/><file name="SaleItemSource.php" hash="3d24b9f71dee66d0b3f91c25deec6dc4"/><file name="SaleSource.php" hash="e6a42a4efe291823d2b3cd5cb38c7518"/></dir><file name="Contiamo.php" hash="7ed0a780d45c090cdd5af6738830ac62"/><dir name="Export"><file name="Collection.php" hash="2ca6280af2cdd7412e9f9bbdc04be6b1"/><file name="CustomAttributes.php" hash="3d798281b48857947316642e86fdd584"/><file name="Customer.php" hash="2b31447c49506f07b42d968619cab062"/><file name="Customers.php" hash="105a08c13f7034f0d8bb6f8212fcdda3"/><file name="Order.php" hash="7f2ac7f23d4f24ee9eac52312dbd7731"/><file name="OrderItem.php" hash="56249ebb4dce0f77da92a14268128ee0"/><file name="OrderItems.php" hash="1be1dbbd461d0b5604abce6b283c14f2"/><file name="OrderUpdates.php" hash="0bba8474dfa37f09a8f55216e1985cd4"/><file name="Orders.php" hash="e2284d473557226c1409b1f04d0fd980"/><file name="Status.php" hash="6ea2248760b40038e925b3024ea81d04"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="3d4b6ecfc461825f115eb6dc8ba3677f"/></dir></dir></dir><dir name="controllers"><file name="ExportController.php" hash="2a6fe5fece69bfbf9395b61e1b91a4bb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="70f5bf8121d1a276e649b9b5fb4ac9cc"/><file name="config.xml" hash="2598d0f9db01729c27a8f6f8833f72ed"/><file name="system.xml" hash="c1aaa3061a5e8fc4ba3ac66a0f408c58"/></dir><dir name="sql"><dir name="contiamo_setup"><file name="mysql4-install-0.0.1.php" hash="8b799197fe5d2567f1510b0777b137b1"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Contiamo_Connector.xml" hash="54eb6cba356dc238f94212376cbd86c1"/></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Contiamo_Connector</name>
4
+ <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Use Contiamo to analyze your sale trends and customer base.</summary>
10
  <description>Use Contiamo to analyze your sale trends and customer base.</description>
11
+ <notes>Minor:&#xD;
12
+ - return order update count from status endpoint</notes>
 
 
13
  <authors><author><name>Chris Baynes</name><user>contiamo</user><email>info@contiamo.com</email></author></authors>
14
+ <date>2015-08-14</date>
15
+ <time>08:30:48</time>
16
+ <contents><target name="magecommunity"><dir name="Contiamo"><dir name="Connector"><dir name="Helper"><file name="Data.php" hash="0b7005dfbd871a92c54f5a66201cde27"/></dir><dir name="Model"><dir name="Admin"><file name="AbstractSource.php" hash="649e273afe1ed9833eaa93c3c9dd9ce0"/><file name="CustomerSource.php" hash="832645ffd3dfc57e0d98ad83325ece02"/><file name="SaleItemSource.php" hash="3d24b9f71dee66d0b3f91c25deec6dc4"/><file name="SaleSource.php" hash="e6a42a4efe291823d2b3cd5cb38c7518"/></dir><file name="Contiamo.php" hash="7ed0a780d45c090cdd5af6738830ac62"/><dir name="Export"><file name="Collection.php" hash="2ca6280af2cdd7412e9f9bbdc04be6b1"/><file name="CustomAttributes.php" hash="3d798281b48857947316642e86fdd584"/><file name="Customer.php" hash="2b31447c49506f07b42d968619cab062"/><file name="Customers.php" hash="105a08c13f7034f0d8bb6f8212fcdda3"/><file name="Order.php" hash="7f2ac7f23d4f24ee9eac52312dbd7731"/><file name="OrderItem.php" hash="56249ebb4dce0f77da92a14268128ee0"/><file name="OrderItems.php" hash="1be1dbbd461d0b5604abce6b283c14f2"/><file name="OrderUpdates.php" hash="0bba8474dfa37f09a8f55216e1985cd4"/><file name="Orders.php" hash="e2284d473557226c1409b1f04d0fd980"/><file name="Status.php" hash="eb211ba504b76deba4375eefb2f90c37"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="3d4b6ecfc461825f115eb6dc8ba3677f"/></dir></dir></dir><dir name="controllers"><file name="ExportController.php" hash="2a6fe5fece69bfbf9395b61e1b91a4bb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="70f5bf8121d1a276e649b9b5fb4ac9cc"/><file name="config.xml" hash="82a29d45458654d29db4aa2f4f7ba939"/><file name="system.xml" hash="c1aaa3061a5e8fc4ba3ac66a0f408c58"/></dir><dir name="sql"><dir name="contiamo_setup"><file name="mysql4-install-0.0.1.php" hash="8b799197fe5d2567f1510b0777b137b1"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Contiamo_Connector.xml" hash="54eb6cba356dc238f94212376cbd86c1"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>