‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Pagination\AbstractPaginator Class Reference
Inheritance diagram for TYPO3\CMS\Core\Pagination\AbstractPaginator:
TYPO3\CMS\Core\Pagination\PaginatorInterface TYPO3\CMS\Core\Pagination\ArrayPaginator TYPO3\CMS\Extbase\Pagination\QueryResultPaginator TYPO3\CMS\Filelist\Pagination\ResourceCollectionPaginator TYPO3\CMS\IndexedSearch\Pagination\SlicePaginator TYPO3\CMS\Reactions\Pagination\DemandedArrayPaginator TYPO3\CMS\Webhooks\Pagination\DemandedArrayPaginator

Public Member Functions

 withItemsPerPage (int $itemsPerPage)
 
 withCurrentPageNumber (int $currentPageNumber)
 
 getNumberOfPages ()
 
 getCurrentPageNumber ()
 
 getKeyOfFirstPaginatedItem ()
 
 getKeyOfLastPaginatedItem ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Pagination\PaginatorInterface
 getPaginatedItems ()
 

Protected Member Functions

 updatePaginatedItems (int $itemsPerPage, int $offset)
 
 getTotalAmountOfItems ()
 
 getAmountOfItemsOnCurrentPage ()
 
 hasItemsOnCurrentPage ()
 
 updateInternalState ()
 
 setItemsPerPage (int $itemsPerPage)
 
 setCurrentPageNumber (int $currentPageNumber)
 

Protected Attributes

int $numberOfPages = 1
 
int $keyOfFirstPaginatedItem = 0
 
int $keyOfLastPaginatedItem = 0
 

Private Attributes

int $currentPageNumber = 1
 
int $itemsPerPage = 10
 

Detailed Description

Definition at line 20 of file AbstractPaginator.php.

Member Function Documentation

◆ getAmountOfItemsOnCurrentPage()

◆ getCurrentPageNumber()

TYPO3\CMS\Core\Pagination\AbstractPaginator::getCurrentPageNumber ( )

Returns the current page number

Implements TYPO3\CMS\Core\Pagination\PaginatorInterface.

Definition at line 73 of file AbstractPaginator.php.

References TYPO3\CMS\Core\Pagination\AbstractPaginator\$currentPageNumber.

◆ getKeyOfFirstPaginatedItem()

TYPO3\CMS\Core\Pagination\AbstractPaginator::getKeyOfFirstPaginatedItem ( )

Returns the key of the first paginated item

This is useful to display the exact range of items that are available via getPaginatedItems

Implements TYPO3\CMS\Core\Pagination\PaginatorInterface.

Definition at line 78 of file AbstractPaginator.php.

References TYPO3\CMS\Core\Pagination\AbstractPaginator\$keyOfFirstPaginatedItem.

◆ getKeyOfLastPaginatedItem()

TYPO3\CMS\Core\Pagination\AbstractPaginator::getKeyOfLastPaginatedItem ( )

Returns the key of the last paginated item

This is useful to display the exact range of items that are available via getPaginatedItems

Implements TYPO3\CMS\Core\Pagination\PaginatorInterface.

Definition at line 83 of file AbstractPaginator.php.

References TYPO3\CMS\Core\Pagination\AbstractPaginator\$keyOfLastPaginatedItem.

◆ getNumberOfPages()

TYPO3\CMS\Core\Pagination\AbstractPaginator::getNumberOfPages ( )

Returns the total number of pages, given the total number of non paginated items and the items per page configuration

Implements TYPO3\CMS\Core\Pagination\PaginatorInterface.

Definition at line 68 of file AbstractPaginator.php.

References TYPO3\CMS\Core\Pagination\AbstractPaginator\$numberOfPages.

Referenced by TYPO3\CMS\Filelist\FileList\getPaginationLinkForPage().

◆ getTotalAmountOfItems()

◆ hasItemsOnCurrentPage()

TYPO3\CMS\Core\Pagination\AbstractPaginator::hasItemsOnCurrentPage ( )
protected

States whether there are items on the current page

Definition at line 107 of file AbstractPaginator.php.

References TYPO3\CMS\Core\Pagination\AbstractPaginator\getAmountOfItemsOnCurrentPage().

Referenced by TYPO3\CMS\Core\Pagination\AbstractPaginator\updateInternalState().

◆ setCurrentPageNumber()

◆ setItemsPerPage()

◆ updateInternalState()

◆ updatePaginatedItems()

TYPO3\CMS\Core\Pagination\AbstractPaginator::updatePaginatedItems ( int  $itemsPerPage,
int  $offset 
)
abstractprotected

◆ withCurrentPageNumber()

TYPO3\CMS\Core\Pagination\AbstractPaginator::withCurrentPageNumber ( int  $currentPageNumber)

Sets the current page to calculate paginated items for

Must return a new instance of the Paginator with an updated internal state

Implements TYPO3\CMS\Core\Pagination\PaginatorInterface.

Definition at line 55 of file AbstractPaginator.php.

References TYPO3\CMS\Core\Pagination\AbstractPaginator\$currentPageNumber.

Referenced by TYPO3\CMS\Filelist\FileList\getPaginationLinkForPage().

◆ withItemsPerPage()

TYPO3\CMS\Core\Pagination\AbstractPaginator::withItemsPerPage ( int  $itemsPerPage)

Sets the amount of paginated items per page

Must return a new instance of the Paginator with an updated internal state

Implements TYPO3\CMS\Core\Pagination\PaginatorInterface.

Definition at line 42 of file AbstractPaginator.php.

References TYPO3\CMS\Core\Pagination\AbstractPaginator\$itemsPerPage.

Member Data Documentation

◆ $currentPageNumber

◆ $itemsPerPage

◆ $keyOfFirstPaginatedItem

int TYPO3\CMS\Core\Pagination\AbstractPaginator::$keyOfFirstPaginatedItem = 0
protected

◆ $keyOfLastPaginatedItem

int TYPO3\CMS\Core\Pagination\AbstractPaginator::$keyOfLastPaginatedItem = 0
protected

◆ $numberOfPages

int TYPO3\CMS\Core\Pagination\AbstractPaginator::$numberOfPages = 1
protected