Example #1
0
 /**
  * Post-process collection items to run afterLoad on each
  *
  * @return $this
  */
 protected function _afterLoad()
 {
     Varien_Data_Collection_Db::_afterLoad();
     foreach ($this->_items as $item) {
         /** @var Mage_Core_Model_Abstract $item */
         $this->getResource()->unserializeFields($item);
         $item->afterLoad();
         $item->setOrigData();
         if ($this->_resetItemsDataChanged) {
             $item->setDataChanges(false);
         }
     }
     Mage::dispatchEvent('core_collection_abstract_load_after', ['collection' => $this]);
     if ($this->_eventPrefix && $this->_eventObject) {
         Mage::dispatchEvent($this->_eventPrefix . '_load_after', [$this->_eventObject => $this]);
     }
     return $this;
 }
Example #2
0
 /**
  * Redeclare after load method for specifying collection items original data
  *
  * @return Mage_Core_Model_Mysql4_Collection_Abstract
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     foreach ($this->_items as $item) {
         $item->setOrigData();
         if ($this->_resetItemsDataChanged) {
             $item->setDataChanges(false);
         }
     }
     Mage::dispatchEvent('core_collection_abstract_load_after', array('collection' => $this));
     return $this;
 }