class ArrayPaginator extends Paginator implements PaginatorInterface

Paginate array

Constants

UNKNOWN

DEFAULT_PER_PAGE

CARD_VIEW

TABLE_VIEW

GRID_VIEW

Properties

protected array $items Paginator items from Paginator
protected integer $currentPage Current page from Paginator
protected integer $lastPage Last page from Paginator
protected integer $perPage Row per page value from Paginator
protected integer $total Total number of items before slice from Paginator

Methods

__construct(array $items, int $page = 1, int $perPage = Paginator::DEFAULT_PER_PAGE)

Constructor

mixed
getItems()

Return items

from Paginator
int
getCurrentPage()

Get current page

from Paginator
mixed
getFirstItem()

Get first item

from Paginator
int
getTotalItems()

Get total items

from Paginator
mixed
getLastItem()

Get last item

from Paginator
int
getLastPage()

Get last page

from Paginator
int
getPerPage()

Get rows per page

from Paginator
int
getItemsCount()

Return items count

from Paginator
array
toArray()

Convert paginator data to array

from Paginator
array
getPaginatorData()

Get paginator data

from Paginator
create(object|array|string $source, int $page = 1, int $perPage = Self::DEFAULT_PER_PAGE)

Create paginator

from Paginator
array
sliceItems(array $items)

Slice array items

from Paginator
int
calcLastPage()

Calc last page

from Paginator

Details

at line 27
__construct(array $items, int $page = 1, int $perPage = Paginator::DEFAULT_PER_PAGE)

Constructor

Parameters

array $items
int $page
int $perPage

in Paginator at line 94
mixed getItems()

Return items

Return Value

mixed

in Paginator at line 104
int getCurrentPage()

Get current page

Return Value

int

in Paginator at line 121
mixed getFirstItem()

Get first item

Return Value

mixed

in Paginator at line 131
int getTotalItems()

Get total items

Return Value

int

in Paginator at line 141
mixed getLastItem()

Get last item

Return Value

mixed

in Paginator at line 151
int getLastPage()

Get last page

Return Value

int

in Paginator at line 161
int getPerPage()

Get rows per page

Return Value

int

in Paginator at line 171
int getItemsCount()

Return items count

Return Value

int

in Paginator at line 181
array toArray()

Convert paginator data to array

Return Value

array

in Paginator at line 194
array getPaginatorData()

Get paginator data

Return Value

array

in Paginator at line 212
static PaginatorInterface create(object|array|string $source, int $page = 1, int $perPage = Self::DEFAULT_PER_PAGE)

Create paginator

Parameters

object|array|string $source
int $page
int $perPage

Return Value

PaginatorInterface

in Paginator at line 253
protected array sliceItems(array $items)

Slice array items

Parameters

array $items

Return Value

array

in Paginator at line 265
protected int calcLastPage()

Calc last page

Return Value

int