I have a database table with 150000 rows. Trying to paginate all these rows causes a fatal error of allowed memory exhausted.
On my controller all I have is:
$rows = Model::find();
// paginate results
$paginator = new \Phalcon\Paginator\Adapter\Model(array(
'data' => $rows,
'limit'=> 20,
'page' => 1,
));
$page = $paginator->getPaginate();
The Resultset is returned correctly by the Model and the fatal error only occurs after getPaginate.
Can anyone help me?