Example #1
0
 /**
  * Set collection for pagination
  *
  * @param  \Magento\Framework\Data\Collection $collection
  * @return $this
  */
 public function setCollection($collection)
 {
     $this->_collection = $collection->setCurPage($this->getCurrentPage());
     // If not int - then not limit
     if ((int) $this->getLimit()) {
         $this->_collection->setPageSize($this->getLimit());
     }
     $this->_setFrameInitialized(false);
     return $this;
 }