/** * Initialize existent customers data * * @return Mage_ImportExport_Model_Export_Entity_Eav_Customer_Address */ protected function _initCustomers() { if (empty($this->_customers)) { // add customer default addresses column name to customer attribute mapping array $this->_customerCollection->addAttributeToSelect(self::$_defaultAddressAttributeMapping); // filter customer collection $this->_customerCollection = $this->_customerEntity->filterEntityCollection($this->_customerCollection); $customers = array(); $addCustomer = function (Mage_Customer_Model_Customer $customer) use(&$customers) { $customers[$customer->getId()] = $customer->getData(); }; $this->_byPagesIterator->iterate($this->_customerCollection, $this->_pageSize, array($addCustomer)); $this->_customers = $customers; } return $this; }
/** * Treat "order by" items as attributes to sort * * @return Mage_Tag_Model_Resource_Customer_Collection */ protected function _renderOrders() { if (!$this->_isOrdersRendered) { parent::_renderOrders(); $orders = $this->getSelect()->getPart(Zend_Db_Select::ORDER); $appliedOrders = array(); foreach ($orders as $order) { $appliedOrders[$order[0]] = true; } foreach ($this->_orders as $field => $direction) { if (empty($appliedOrders[$field])) { $this->_select->order(new Zend_Db_Expr($field . ' ' . $direction)); } } } return $this; }
public function load($printQuery = false, $logQuery = false) { parent::load($printQuery, $logQuery); $this->_loadTags($printQuery, $logQuery); return $this; }
/** * Adds field to filter * * @param string $attribute * @param array $condition * @return Mage_Tag_Model_Resource_Customer_Collection */ public function addFieldToFilter($attribute, $condition = null) { if ($attribute == 'name') { $where = $this->_getConditionSql('t.name', $condition); $this->getSelect()->where($where, null, Varien_Db_Select::TYPE_CONDITION); return $this; } else { return parent::addFieldToFilter($attribute, $condition); } }