<?php
// Example
// we can instantiate paginator in controller
$this->view->paginator = $table->getPaginator($table->getSelectLastNews(), $page, $limit);
// and fetch all entries
$this->view->last_news = $table->fetchAll($table->getSelectLastNews());
// OR we can use the following code
$this->view->paginator = $table->getSelectLastNews()->getPaginator($page, $limit);
$this->view->last_news = $table->getSelectLastNews()->fetchAll(/* $limit */);
// solution in Db_Table_Select
public function fetchAll($limit = 10) // proxy
{
return $this->getTable()->fetchAll($this->limit($limit));
}
public function getPaginator($page, $limit = 10) // proxy
{
// assume we have Paginator in Model
return $this->getTable()->getPaginator($select, $page, $limit);
}
Comments
Posted by Rob Allen (rob) on 2012-11-20T20:52:45.000+0000
Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".
Feel free to re-open and provide a patch if you want to fix this issue.