Beispiel #1
0
 /**
  * Processing collection items after loading
  * Raise additional event
  *
  * @return Mage_Catalog_Model_Resource_Product_Collection
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     if (count($this) > 0) {
         Mage::dispatchEvent('mongo_catalog_product_collection_load_after', array('collection' => $this));
     }
     return $this;
 }
Beispiel #2
0
 /**
  * Set store id for each collection item when collection was loaded
  *
  * @return void
  */
 public function _afterLoad()
 {
     parent::_afterLoad();
     if ($this->getStoreId() && $this->_items) {
         foreach ($this->_items as $item) {
             $item->setStoreId($this->getStoreId());
         }
     }
     return $this;
 }
Beispiel #3
0
 /**
  * Action after load
  *
  * @return Mage_Review_Model_Resource_Review_Product_Collection
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     if ($this->_addStoreDataFlag) {
         $this->_addStoreData();
     }
     return $this;
 }
 /**
  * Reorder collection according to current sort order.
  *
  * @return Smile_ElasticSearch_Model_Resource_Catalog_Product_Collection
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     if (!empty($this->_searchedEntityIds)) {
         $sortedItems = array();
         foreach ($this->_searchedEntityIds as $id) {
             if (isset($this->_items[$id])) {
                 $sortedItems[$id] = $this->_items[$id];
             }
         }
         $this->_items =& $sortedItems;
     }
     return $this;
 }
Beispiel #5
0
 /**
  * After load adding data
  *
  * @return Mage_Tag_Model_Resource_Product_Collection
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     if ($this->getFlag('add_stores_after')) {
         $this->_addStoresVisibility();
     }
     if (count($this) > 0) {
         Mage::dispatchEvent('tag_tag_product_collection_load_after', array('collection' => $this));
     }
     return $this;
 }
Beispiel #6
0
 /**
  * Sort items
  *
  * @return Mage_Catalog_Model_Resource_Product_Collection
  */
 protected function _afterLoad()
 {
     $result = parent::_afterLoad();
     $this->_sort();
     return $result;
 }
Beispiel #7
0
 /**
  * Sort collection items by sort order of found ids
  *
  * @return Enterprise_Search_Model_Resource_Collection
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     $sortedItems = array();
     foreach ($this->_searchedEntityIds as $id) {
         if (isset($this->_items[$id])) {
             $sortedItems[$id] = $this->_items[$id];
         }
     }
     $this->_items =& $sortedItems;
     /**
      * Revert page size for proper paginator ranges
      */
     $this->_pageSize = $this->_storedPageSize;
     return $this;
 }
 /**
  * Sort collection items by sort order of found ids
  *
  * @return Enterprise_Search_Model_Resource_Collection
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     $this->_items = $this->_sortResultItems();
     /**
      * Revert page size for proper paginator ranges
      */
     $this->_pageSize = $this->_storedPageSize;
     return $this;
 }