예제 #1
0
 /**
  * Test setCustomerFilter() using array of Ids as possible filter
  */
 public function testSetArrayAsCustomerFilter()
 {
     $customerIds = array(1, 2);
     $expectedString = "parent_id IN (" . implode(',', $customerIds) . ")";
     $this->_collection->getConnection()->expects($this->any())->method('prepareSqlCondition')->with($this->stringContains('parent_id'), array('in' => $customerIds))->will($this->returnValue($expectedString));
     $this->_collection->setCustomerFilter($customerIds);
     $this->assertContains('(' . $expectedString . ')', $this->_collection->getSelect()->getPart(Zend_Db_Select::WHERE));
 }
예제 #2
0
 /**
  * Export process
  *
  * @return string
  */
 public function export()
 {
     // skip and filter by customer address attributes
     $this->_addressCollection = $this->_prepareEntityCollection($this->_addressCollection);
     $this->_addressCollection->setCustomerFilter(array_keys($this->_customers));
     // prepare headers
     $this->getWriter()->setHeaderCols(array_merge($this->_permanentAttributes, $this->_getExportAttributeCodes(), array_keys(self::$_defaultAddressAttributeMapping)));
     $this->_exportCollectionByPages($this->_addressCollection);
     return $this->getWriter()->getContents();
 }