Beta version

class Paginator

A simple paginator class to filter entities with limit and search.

Methods

__construct(EntityManager $em, string $entityName, integer $itemPerPages = 10, array $criteria = array())

No description

string
getSearchPattern()

No description

$this
setSearchPattern(string $searchPattern)

No description

int
getTotalCount()

Return total entities count for given criteria.

int
getPageCount()

Return page count according to criteria.

array
findByAtPage(array $order = array(), integer $page = 1)

Return entities filtered for current page.

array
searchByAtPage(array $order = array(), integer $page = 1)

Use a search query to paginate instead of a findBy.

$this
setItemsPerPage(integer $itemsPerPage)

No description

integer
getItemsPerPage()

No description

Details

at line 53
__construct(EntityManager $em, string $entityName, integer $itemPerPages = 10, array $criteria = array())

Parameters

EntityManager $em Entity manager
string $entityName Full qualified entity classname
integer $itemPerPages Item par pages
array $criteria Force selection criteria

at line 75
string getSearchPattern()

Return Value

string

at line 85
$this setSearchPattern(string $searchPattern)

Parameters

string $searchPattern

Return Value

$this

at line 97
int getTotalCount()

Return total entities count for given criteria.

Return Value

int

at line 119
int getPageCount()

Return page count according to criteria.

Warning : EntityRepository must implements countBy method

Return Value

int

at line 132
array findByAtPage(array $order = array(), integer $page = 1)

Return entities filtered for current page.

Parameters

array $order
integer $page

Return Value

array

at line 155
array searchByAtPage(array $order = array(), integer $page = 1)

Use a search query to paginate instead of a findBy.

Parameters

array $order
integer $page

Return Value

array

at line 172
$this setItemsPerPage(integer $itemsPerPage)

Parameters

integer $itemsPerPage

Return Value

$this

at line 181
integer getItemsPerPage()

Return Value

integer $itemsPerPage