Skip to content

Instantly share code, notes, and snippets.

@tomtone
Last active December 23, 2015 12:19
Show Gist options
  • Save tomtone/6635033 to your computer and use it in GitHub Desktop.
Save tomtone/6635033 to your computer and use it in GitHub Desktop.
so sollte es aussehen
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Customer
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Customer api
*
* @category Mage
* @package Mage_Customer
* @author Magento Core Team <core@magentocommerce.com>
*/
class Interwall_EvolverSSOIntegration_Model_Customer_Api_V2 extends Mage_Customer_Model_Customer_Api_V2
{
private $_attributeCode = array(
'debit_payment_acount_blz',
'debit_payment_acount_number'
);
/**
* Retrieve customers data
*
* @param object|array $filters
* @return array
*/
public function items($filters)
{
$collection = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*');
/** @var $apiHelper Mage_Api_Helper_Data */
$apiHelper = Mage::helper('api');
$filters = $apiHelper->parseFilters($filters, $this->_mapAttributes);
try {
foreach ($filters as $field => $value) {
$collection->addFieldToFilter($field, $value);
}
} catch (Mage_Core_Exception $e) {
$this->_fault('filters_invalid', $e->getMessage());
}
$result = array();
foreach ($collection as $customer) {
$data = $customer->toArray();
$row = array();
foreach ($this->_mapAttributes as $attributeAlias => $attributeCode) {
$row[$attributeAlias] = (isset($data[$attributeCode]) ? $data[$attributeCode] : null);
}
foreach ($this->getAllowedAttributes($customer) as $attributeCode => $attribute) {
if (isset($data[$attributeCode])) {
$row[$attributeCode] = $data[$attributeCode];
}
}
foreach($this->_attributeCode as $_code){
if(in_array($_code, $row)){
$tmp = $row[$_code];
$row[$_code] = MAge::helper('core')->decrypt($tmp);
}
}
$result[] = $row;
}
return $result;
}
} // Class Mage_Customer_Model_Customer_Api End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment