The thing is though, that Zend_Paginator
has a very convenient set of adapters. One of these is Zend_Paginator_Adapter_DbSelect
which allows you to enclose a Zend_Db_Select
query for efficiently paginating a sql query (e.g. limiting the results). So I can see why you are wondering where to construct these. Although you can indeed debate whether the model is the best place, I personally don't have a problem with creating a method in my model like:
public function fetchEntitiesAsPaginator();
... which would return a Zend_Paginator
instance injected with a Zend_Paginator_Adapter_DbSelect
.
BTW:
I personally don't consider a paginator just for presentation. I just consider it as a glorified LimitIterator. When you look at it from that perspective, things are starting to look a bit different already. And as a side note: the presentation concerns of Zend_Paginator
are seperated by the Zend_View_Helper_PaginationControl
view helper already anyway.