/** * Join linked products when specified link model * * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Link_Product_Collection */ protected function _beforeLoad() { if ($this->getLinkModel()) { $this->_joinLinks(); } return parent::_beforeLoad(); }
/** * Redeclare parent method for store filters applying * * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */ protected function _beforeLoad() { parent::_beforeLoad(); $this->_applyStoresFilterToSelect(); return $this; }
/** * Search documents by query * Set found ids and number of found results * * @return Enterprise_Search_Model_Resource_Collection */ protected function _beforeLoad() { $ids = array(); if ($this->_engine) { list($query, $params) = $this->_prepareBaseParams(); if ($this->_sortBy) { $params['sort_by'] = $this->_sortBy; } $page = $this->_curPage > 0 ? $this->_curPage : 1; $rowCount = $this->_pageSize > 0 ? $this->_pageSize : 1; $params['offset'] = (int) $rowCount * ($page - 1); $params['limit'] = (int) $rowCount; $params['solr_params']['facet'] = 'on'; $params['facet'] = $this->_facetedConditions; $result = $this->_engine->getIdsByQuery($query, $params); $ids = (array) $result['ids']; $this->_facetedData = $result['facetedData']; } $this->_searchedEntityIds =& $ids; $this->getSelect()->where('e.entity_id IN (?)', $this->_searchedEntityIds); /** * To prevent limitations to the collection, because of new data logic */ $this->_pageSize = false; return parent::_beforeLoad(); }