I make a query via createBuilder
and when executing it getQuery()->execute()->toArray()
I got 10946
elements. I want to paginate it, so I pass it to:
$paginator = new \Phalcon\Paginator\Adapter\QueryBuilder(array(
"builder" => $builder,
"limit" => $limit,
"page" => $current_page
));
$limit
is 25
and $current_page
is 1
, but when doing:
$paginator->getPaginate();
$page->total_items;
returns 1
.
Is that a bug or am I missing something?
UPD: Phalcon version is 1.3.2
UPD2: Duplicate on stackoverflow: https://stackoverflow.com/questions/25502262/phalcon-querybuilder-total-items-always-returns-1