Phalcon v4.0 removed "getPaginate()" and now paginator no longer works!
Here is code example used;
use Phalcon\Paginator\Adapter\NativeArray;
$array = [
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
5 => 'five',
6 => 'six',
7 => 'seven',
8 => 'eight',
9 => 'nine',
10 => 'ten',
];
$test = new NativeArray([
'data' => $array,
'limit' => 1,
'page' => 1,
]);
print_r($test);
This loads all 10 items instead of 1.
Phalcon\Paginator\Adapter\NativeArray Object
(
[_limitRows:protected] => 1
[_page:protected] => 0
[_repository:protected] =>
[_config:protected] => Array
(
[page] =>
[limit] => 1
[data] => Array
(
[1] => one
[2] => two
[3] => three
[4] => four
[5] => five
[6] => six
[7] => seven
[8] => eight
[9] => nine
[10] => ten
)
)
)
What am I missing here? Thank You!