/** * Validate data row * * @param array $rowData * @param int $rowNumber * @return boolean */ public function validateRow(array $rowData, $rowNumber) { $rowScope = $this->_getRowScope($rowData); if ($rowScope == self::SCOPE_DEFAULT) { if ($this->_customerEntity->validateRow($rowData, $rowNumber)) { $this->_currentWebsiteCode = $rowData[Mage_ImportExport_Model_Import_Entity_Eav_Customer::COLUMN_WEBSITE]; $this->_currentEmail = strtolower($rowData[Mage_ImportExport_Model_Import_Entity_Eav_Customer::COLUMN_EMAIL]); // Add new customer data into customer storage for address entity instance $websiteId = $this->_customerEntity->getWebsiteId($this->_currentWebsiteCode); if (!$this->_addressEntity->getCustomerStorage()->getCustomerId($this->_currentEmail, $websiteId)) { $customerData = new Varien_Object(array('id' => $this->_nextCustomerId, 'email' => $this->_currentEmail, 'website_id' => $websiteId)); $this->_addressEntity->getCustomerStorage()->addCustomer($customerData); $this->_nextCustomerId++; } return $this->_validateAddressRow($rowData, $rowNumber); } else { $this->_currentWebsiteCode = null; $this->_currentEmail = null; } } else { if (!empty($this->_currentWebsiteCode) && !empty($this->_currentEmail)) { return $this->_validateAddressRow($rowData, $rowNumber); } else { $this->addRowError(self::ERROR_ROW_IS_ORPHAN, $rowNumber); } } return false; }