Hola Pablo,
Respondiendo a tu mensaje, espero que encuentres este ejemplo util:
Código PHP:
<?php
class Users extends Zend_Db_Table_Abstract
{
protected $_name = 'users';
protected $_primary = 'id';
public function getByGroupId($groupid, $page = 1)
{
$select = $this->select()
->from($this->_name)
->where('group_id = ?', $groupid);
$adapter = new Zend_Paginator_Adapter_DbTableSelect($select);
$count = clone $select;
$count->reset(Zend_Db_Select::COLUMNS);
$count->reset(Zend_Db_Select::FROM);
$count->from($this->_name, new Zend_Db_Expr('COUNT(*) AS total'));
$adapter->setRowCount($count);
$paginator = new Zend_Paginator($adapter);
$paginator->setItemsCountPerPage(10);
$paginator->setCurrentPageNumber($page);
return $paginator;
}
}
Un saludo