/** * Constructor * * @param array $data */ public function __construct(array $data = array()) { if (isset($data['attribute_collection'])) { $this->_attributeCollection = $data['attribute_collection']; unset($data['attribute_collection']); } else { $this->_attributeCollection = Mage::getResourceModel(static::ATTRIBUTE_COLLECTION_NAME); $this->_attributeCollection->addSystemHiddenFilterWithPasswordHash(); $data['attribute_collection'] = $this->_attributeCollection; } parent::__construct($data); $this->_specialAttributes[] = self::COLUMN_WEBSITE; $this->_specialAttributes[] = self::COLUMN_STORE; $this->_permanentAttributes[] = self::COLUMN_EMAIL; $this->_permanentAttributes[] = self::COLUMN_WEBSITE; $this->_indexValueAttributes[] = 'group_id'; $this->addMessageTemplate(self::ERROR_DUPLICATE_EMAIL_SITE, $this->_helper('Mage_ImportExport_Helper_Data')->__('E-mail is duplicated in import file')); $this->addMessageTemplate(self::ERROR_ROW_IS_ORPHAN, $this->_helper('Mage_ImportExport_Helper_Data')->__('Orphan rows that will be skipped due default row errors')); $this->addMessageTemplate(self::ERROR_INVALID_STORE, $this->_helper('Mage_ImportExport_Helper_Data')->__('Invalid value in Store column (store does not exists?)')); $this->addMessageTemplate(self::ERROR_EMAIL_SITE_NOT_FOUND, $this->_helper('Mage_ImportExport_Helper_Data')->__('E-mail and website combination is not found')); $this->addMessageTemplate(self::ERROR_PASSWORD_LENGTH, $this->_helper('Mage_ImportExport_Helper_Data')->__('Invalid password length')); $this->_initStores(true)->_initAttributes(); $this->_customerModel = Mage::getModel('Mage_Customer_Model_Customer'); /** @var $customerResource Mage_Customer_Model_Resource_Customer */ $customerResource = $this->_customerModel->getResource(); $this->_entityTable = $customerResource->getEntityTable(); }