when i want to paginate from query builder i got an error on below
Fatal error: Phalcon\Paginator\Adapter\QueryBuilder::getPaginate() [<a href='phalcon\paginator\adapter\querybuilder.getpaginate'>phalcon\paginator\adapter\querybuilder.getpaginate</a>]: Call to undefined method limit() on class Phalcon\Mvc\Model\Resultset\Simple in C:\wamp\www\popsbuy\app\controllers\OrdersController.php on line 65
My Code:
$orders = $order->getUserOrders();
$paginator = new Phalcon\Paginator\Adapter\QueryBuilder(array(
"builder" => $orders,
"limit" => 20,
"page" => 1
));
// Get the paginated results
$page = $paginator->getPaginate();