Beispiel #1
0
 /**
  * Set collection to pager
  *
  * @param Varien_Data_Collection $collection
  * @return Mage_Catalog_Block_Product_List_Toolbar
  */
 public function setCollection($collection)
 {
     $this->_collection = $collection;
     $this->_collection->setCurPage($this->getCurrentPage());
     // we need to set pagination only if passed value integer and more that 0
     $limit = (int) $this->getLimit();
     if ($limit) {
         $this->_collection->setPageSize($limit);
     }
     if ($this->getCurrentOrder()) {
         $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
     }
     return $this;
 }
Beispiel #2
0
 /**
  * Set page size
  *
  * @param int $size
  * @return Mage_Core_Model_Resource_Theme_Collection
  */
 public function setPageSize($size = self::DEFAULT_PAGE_SIZE)
 {
     return parent::setPageSize($size);
 }
 protected function prepareCollection(Mage_Core_Model_Resource_Db_Collection_Abstract $collection)
 {
     $collection->getSelect()->limit();
     $collection->setPageSize(0);
     $collection->load();
 }