Arikaim CMS

DbPaginator extends Paginator
in package
implements PaginatorInterface

Paginate Illuminate\Database\Eloquent\Builder objects

Table of Contents

Interfaces

PaginatorInterface
Paginator interface

Constants

CARD_VIEW  = 'card'
DEFAULT_PER_PAGE  = 25
GRID_VIEW  = 'grid'
TABLE_VIEW  = 'table'
UNKNOWN  = -1

Properties

$currentPage  : int
Current page
$items  : array<string|int, mixed>|mixed
Paginator items
$lastPage  : int
Last page
$perPage  : int
Row per page value
$total  : int
Total number of items before slice

Methods

__construct()  : mixed
Constructor
create()  : PaginatorInterface
Create paginator
getCurrentPage()  : int
Get current page
getFirstItem()  : mixed
Get first item
getItems()  : mixed
Return items
getItemsCount()  : int
Return items count
getLastItem()  : mixed
Get last item
getLastPage()  : int
Get last page
getPaginatorData()  : array<string|int, mixed>
Get paginator data
getPerPage()  : int
Get rows per page
getTotalItems()  : int
Get total items
toArray()  : array<string|int, mixed>
Convert paginator data to array
calcLastPage()  : int
Calc last page
sliceItems()  : array<string|int, mixed>
Slice array items

Constants

DEFAULT_PER_PAGE

public mixed DEFAULT_PER_PAGE = 25

TABLE_VIEW

public mixed TABLE_VIEW = 'table'

Properties

$currentPage

Current page

protected int $currentPage

$items

Paginator items

protected array<string|int, mixed>|mixed $items

$perPage

Row per page value

protected int $perPage = Self::DEFAULT_PER_PAGE

$total

Total number of items before slice

protected int $total

Methods

__construct()

Constructor

public __construct(Builder $builder[, int $page = 1 ][, int $perPage = Paginator::DEFAULT_PER_PAGE ]) : mixed
Parameters
$builder : Builder
$page : int = 1
$perPage : int = Paginator::DEFAULT_PER_PAGE

create()

Create paginator

public static create(object|array<string|int, mixed>|string $source[, int $page = 1 ][, int|null $perPage = Self::DEFAULT_PER_PAGE ]) : PaginatorInterface
Parameters
$source : object|array<string|int, mixed>|string
$page : int = 1
$perPage : int|null = Self::DEFAULT_PER_PAGE
Return values
PaginatorInterface

getCurrentPage()

Get current page

public getCurrentPage() : int
Return values
int

getFirstItem()

Get first item

public getFirstItem() : mixed

getItems()

Return items

public getItems() : mixed

getItemsCount()

Return items count

public getItemsCount() : int
Return values
int

getLastItem()

Get last item

public getLastItem() : mixed

getLastPage()

Get last page

public getLastPage() : int
Return values
int

getPaginatorData()

Get paginator data

public getPaginatorData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPerPage()

Get rows per page

public getPerPage() : int
Return values
int

getTotalItems()

Get total items

public getTotalItems() : int
Return values
int

toArray()

Convert paginator data to array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

calcLastPage()

Calc last page

protected calcLastPage() : int
Return values
int

sliceItems()

Slice array items

protected sliceItems(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results