‪TYPO3CMS  11.5
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

Public Member Functions

 withItemsPerPage (int $itemsPerPage)
 
 withCurrentPageNumber (int $currentPageNumber)
 
 getNumberOfPages ()
 
 getCurrentPageNumber ()
 
 getKeyOfFirstPaginatedItem ()
 
 getKeyOfLastPaginatedItem ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Pagination\PaginatorInterface
iterable 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()

TYPO3\CMS\Core\Pagination\AbstractPaginator::getAmountOfItemsOnCurrentPage ( )
abstractprotected

Must return the amount of paginated items on the current page

Reimplemented in TYPO3\CMS\Extbase\Pagination\QueryResultPaginator, and TYPO3\CMS\Core\Pagination\ArrayPaginator.

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

◆ 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.

◆ getTotalAmountOfItems()

TYPO3\CMS\Core\Pagination\AbstractPaginator::getTotalAmountOfItems ( )
abstractprotected

◆ 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()

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

◆ setItemsPerPage()

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

◆ updateInternalState()

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

◆ updatePaginatedItems()

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

Must update the paginated items, i.e. the subset of all items, limited and defined by the given amount of items per page and offset

Reimplemented in TYPO3\CMS\Extbase\Pagination\QueryResultPaginator, and TYPO3\CMS\Core\Pagination\ArrayPaginator.

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

◆ 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.

◆ 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