Reputation: 4705
is there a way, hot to apply paginator limit on select, which I send to findDependentRowset function? for example:
$select = $row->select();
$select->order('item_name');
$row->findDependentRowset($table, null, $select)
thank's
Upvotes: 3
Views: 1163
Reputation: 4705
this looks good, but paginator will don't have information about all rows count. I found solution to override Zend_Paginator_Adapter_DbSelect and set function
public function getItems($offset, $itemCountPerPage)
{
$this->_select->limit($itemCountPerPage, $offset);
return $this->_select;
}
this will return select with applied limit and I can use Paginator with its whole funcionality
Upvotes: 0
Reputation: 402
You need just add limit to your select passed to findDependentRowset. It will look like this:
$select = $row->select()->limit($itemCountPerPage,$offset);
$select->order('item_name');
$row->findDependentRowset($table, null, $select);
Upvotes: 1