victor-codigo / doctrine-paginator-adapter
A doctrine paginator
Installs: 34
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/victor-codigo/doctrine-paginator-adapter
Requires
- php: >=8.1
- doctrine/orm: >=2.20.0 <4.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.67
- phpstan/phpstan: ^2.1
- phpstan/phpstan-doctrine: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^11.5
README
Description
PHP classes for doctrine pagination
Requeriments
Usage
Development
Installation
Install with Composer:
composer require victor-codigo/doctrine-paginator-adapter
Classes
DoctrinePaginatorAdapter: Class to create the pagination
PaginatorInterface: Interface for paginator adapter
PaginatorException: Page exceptions
Usage
DoctrinePaginatorAdapter methods:
| Method | Description | Params | Return |
|---|---|---|---|
| __construct | Creates a class instance | 1. Doctrine\ORM\Tools\Pagination\Paginator or null: doctrine paginator | |
| createPaginator | Creates a new instance of DoctrinePaginatorAdapter | 1. Doctrine\ORM\Query or Doctrine\ORM\QueryBuilder: Query to create pagination | DoctrinePaginatorAdapter<TKey, TResult> |
| getPageItems | Gets the number of items by page | int or null | |
| setPagination | Sets the page to return, and the number of items per page | 1. int: Page number. 2. int: Number of items by page |
DoctrinePaginatorAdapter<TKey, TResult> |
| getPagesRange | Get a range of pages | 1. int: First page. 2. int: Last page. 3. int: Number of items per page |
\Generator |
| getAllPages | Gets all pages | int: Number of items per page | \Generator |
| getPageCurrent | Gets current page | int | |
| getPagesTotal | Gets the total number of pages | int | |
| hasNext | Gets if there is another page after the current page | int | |
| hasPrevious | Gets if there is a page before the current page | int | |
| getPageNextNumber | Gets the number of the page after | int or null | |
| getPagePreviousNumber | Gets the number of the page before | int or null | |
| getItemsTotal and count |
Gets the total number of items | int | |
| getIterator | Gets an iterator of the current page | \Tarversable |