ZF-7931: Fetching methods for Zend_Db_Table_Select

Issue Type: Improvement Created: 2009-09-23T04:50:52.000+0000 Last Updated: 2012-11-20T20:52:45.000+0000 Status: Closed Fix version(s): Reporter: Mokevnin Kirill (toxic-mt) Assignee: None Tags: - Zend_Db_Select

Related issues: Attachments:


<pre class="highlight"> 

// 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);


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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.