class NodePaginator extends Paginator (View source)

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

This class add some translation and security filters

Properties

protected $itemsPerPage from Paginator
protected $itemCount from Paginator
protected $entityName from Paginator
protected $criteria from Paginator
protected $searchPattern from Paginator
protected $em from Paginator
protected $totalCount from Paginator
protected $authorizationChecker
protected $preview
protected $translation

Methods

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

No description

from Paginator
string
getSearchPattern()

No description

from Paginator
$this
setSearchPattern(string $searchPattern)

No description

from Paginator
int
getTotalCount()

No description

int
getPageCount()

Return page count according to criteria.

from Paginator
array|Paginator
findByAtPage(array $order = [], integer $page = 1)

Return entities filtered for current page.

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

Use a search query to paginate instead of a findBy.

from Paginator
$this
setItemsPerPage(integer $itemsPerPage)

No description

from Paginator
integer
getItemsPerPage()

No description

from Paginator
AuthorizationChecker
getAuthorizationChecker()

No description

$this
setAuthorizationChecker(AuthorizationChecker $authorizationChecker = null)

No description

getTranslation()

No description

$this
setTranslation(Translation $newtranslation = null)

No description

boolean
getPreview()

Gets the value of preview.

setPreview(boolean $preview)

Sets the value of preview.

Details

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

Parameters

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

string getSearchPattern()

Return Value

string

$this setSearchPattern(string $searchPattern)

Parameters

string $searchPattern

Return Value

$this

int getTotalCount()

Return Value

int

int getPageCount()

Return page count according to criteria.

Warning : EntityRepository must implements countBy method

Return Value

int

array|Paginator findByAtPage(array $order = [], integer $page = 1)

Return entities filtered for current page.

Parameters

array $order
integer $page

Return Value

array|Paginator

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

Use a search query to paginate instead of a findBy.

Parameters

array $order
integer $page

Return Value

array

$this setItemsPerPage(integer $itemsPerPage)

Parameters

integer $itemsPerPage

Return Value

$this

integer getItemsPerPage()

Return Value

integer $itemsPerPage

AuthorizationChecker getAuthorizationChecker()

Return Value

AuthorizationChecker

$this setAuthorizationChecker(AuthorizationChecker $authorizationChecker = null)

Parameters

AuthorizationChecker $authorizationChecker

Return Value

$this

Translation getTranslation()

Return Value

Translation

$this setTranslation(Translation $newtranslation = null)

Parameters

Translation $newtranslation

Return Value

$this

boolean getPreview()

Gets the value of preview.

Return Value

boolean

NodePaginator setPreview(boolean $preview)

Sets the value of preview.

Parameters

boolean $preview the preview

Return Value

NodePaginator