Exemple #1
0
 /**
  * @param PHPUnit_Framework_MockObject_MockObject|Zend_Db_Adapter_Abstract $adapter
  * @depends testSetAddOrder
  */
 public function testUnshiftOrder($adapter)
 {
     $this->_collection->setConnection($adapter);
     $this->_collection->addOrder('some_field', Varien_Data_Collection::SORT_ORDER_ASC);
     $this->_collection->unshiftOrder('other_field', Varien_Data_Collection::SORT_ORDER_ASC);
     $this->_collection->load();
     $selectOrders = $this->_collection->getSelect()->getPart(Zend_Db_Select::ORDER);
     $this->assertEquals('other_field ASC', (string) array_shift($selectOrders));
     $this->assertEquals('some_field ASC', (string) array_shift($selectOrders));
     $this->assertEmpty(array_shift($selectOrders));
 }
Exemple #2
0
 public function load($printQuery = false, $logQuery = false)
 {
     if ($this->isLoaded()) {
         return $this;
     }
     parent::load($printQuery, $logQuery);
     foreach ($this as $_item) {
         $_item->setAttribute($this->getAttributeBackend()->getAttribute());
     }
     return $this;
 }
Exemple #3
0
 /**
  * Load data
  *
  * @return  Varien_Data_Collection_Db
  */
 public function load($printQuery = false, $logQuery = false)
 {
     if (!$this->isLoaded()) {
         Mage::dispatchEvent('core_collection_abstract_load_before', array('collection' => $this));
     }
     parent::load($printQuery, $logQuery);
     foreach ($this->_items as $item) {
         $item->setOrigData();
     }
     return $this;
 }
Exemple #4
0
 /**
  * Load subscribes to collection
  *
  * @param boolean $printQuery
  * @param boolean $logQuery
  * @return Varien_Data_Collection_Db
  */
 public function load($printQuery = false, $logQuery = false)
 {
     if ($this->isLoaded()) {
         return $this;
     }
     parent::load($printQuery, $logQuery);
     return $this;
 }
Exemple #5
0
 public function collectionToCsv(Varien_Data_Collection_Db $collection, $arrRequiredFields = array())
 {
     if (!$collection->isLoaded()) {
         $collection->load();
     }
     $data = $collection->toArray($arrRequiredFields);
     if (!$collection instanceof Mage_Eav_Model_Entity_Collection_Abstract) {
         $data = isset($data['items']) ? $data['items'] : array();
     }
     return $this->dataToCsv($data);
 }
Exemple #6
0
 public function load($printQuery = false, $logQuery = false)
 {
     if ($this->isLoaded()) {
         return $this;
     }
     parent::load($printQuery, $logQuery);
     if ($this->_addStoreDataFlag) {
         $this->_addStoreData();
     }
     return $this;
 }
 /**
  * Load data
  *
  * @return  Varien_Data_Collection_Db
  */
 public function load($printQuery = false, $logQuery = false)
 {
     parent::load($printQuery, $logQuery);
     foreach ($this->_items as $item) {
         $item->setOrigData();
     }
     return $this;
 }
 public function load($printQuery = false, $logQuery = false)
 {
     if ($this->isLoaded()) {
         return $this;
     }
     Mage::dispatchEvent('review_review_collection_load_before', array('collection' => $this));
     parent::load($printQuery, $logQuery);
     if ($this->_addStoreDataFlag) {
         $this->_addStoreData();
     }
     return $this;
 }
 public function load($printQuery = false, $logQuery = false)
 {
     if ($this->isLoaded()) {
         return $this;
     }
     Mage::dispatchEvent('log_visitor_collection_load_before', array('collection' => $this));
     return parent::load($printQuery, $logQuery);
 }
Exemple #10
0
 /**
  * Load data
  *
  * @return  Varien_Data_Collection_Db
  */
 public function load($printQuery = false, $logQuery = false)
 {
     if (!$this->isLoaded()) {
         Mage::dispatchEvent('core_collection_abstract_load_before', array('collection' => $this));
     }
     parent::load($printQuery, $logQuery);
     return $this;
 }