Skip to content

Commit

Permalink
Added result output for shell
Browse files Browse the repository at this point in the history
  • Loading branch information
avstudnitz committed Oct 15, 2012
1 parent eae1121 commit 892aa18
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions app/code/community/IntegerNet/Anonymizer/Model/Anonymizer.php
Expand Up @@ -37,19 +37,6 @@ public function anonymizeAll()
$this->_anonymizeRemainingQuoteAddresses();
}

public function getResults()
{
return array(
'Customers' => sizeof($this->_anonymizedCustomerIds),
'Customers Addresses' => sizeof($this->_anonymizedCustomerAddressIds),
'Orders' => sizeof($this->_anonymizedOrderIds),
'Order Addresses' => sizeof($this->_anonymizedOrderAddressIds),
'Quotes' => sizeof($this->_anonymizedQuoteIds),
'Quote Addresses' => sizeof($this->_anonymizedQuoteAddressIds),
'Newsletter Subscribers' => sizeof($this->_anonymizedNewsletterSubscriberIds),
);
}

/**
* @param Mage_Customer_Model_Resource_Customer_Collection $customers
*/
Expand Down Expand Up @@ -316,7 +303,7 @@ protected function _anonymizeRemainingQuoteAddresses()
{
$quoteAddresses = Mage::getModel('sales/quote_address')
->getCollection()
->addFieldToFilter('address_id', array('nin' => $this->_anonymizedOrderAddressIds));
->addFieldToFilter('address_id', array('nin' => $this->_anonymizedQuoteAddressIds));

foreach($quoteAddresses as $quoteAddress) {

Expand Down Expand Up @@ -522,4 +509,20 @@ protected function _fetchRandomCustomerData($count)

return $this->_unusedCustomerData;
}

/**
* @return array
*/
public function getResults()
{
return array(
'Customers' => sizeof($this->_anonymizedCustomerIds),
'Customers Addresses' => sizeof($this->_anonymizedCustomerAddressIds),
'Orders' => sizeof($this->_anonymizedOrderIds),
'Order Addresses' => sizeof($this->_anonymizedOrderAddressIds),
'Quotes' => sizeof($this->_anonymizedQuoteIds),
'Quote Addresses' => sizeof($this->_anonymizedQuoteAddressIds),
'Newsletter Subscribers' => sizeof($this->_anonymizedNewsletterSubscriberIds),
);
}
}

0 comments on commit 892aa18

Please sign in to comment.