Well, let's take a look at following model method:
Its purpose is really straightforward - it looks up all pages related to a category.PHP Code:public function getPages($category)
{
$select = $this->select();
$select->where('id = ?', $id);
$category = $this->fetchRow($select);
return $category->findManyToManyRowset('Pages', 'JoinPagesCategories');
}
The problem:
I need to paginate the results from the method above and I would like to pass a Zend_Db_Select to the paginator instead of already fetched results for performance reasons (if there are too many pages under a category, why not paginate it).
But the following doesn't work:
Any ideas? Just asking.PHP Code:public function getPages($category)
{
$select = $this->select();
$select->where('id = ?', $id);
return $select->findManyToManyRowset('Pages', 'JoinPagesCategories');
}
I know Zend_Db_Select doesn't have findManyToManyRowset() method so the above was just a desperate attempt. I have read through the whole Zend_Db_Table documentation and this isn't adressed there so I'm wondering if it's possible (imho it should be... this isn't an uncommon situation).





Bookmarks