Download the PHP package lampager/lampager-doctrine2 without Composer
On this page you can find all versions of the php package lampager/lampager-doctrine2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package lampager-doctrine2
Lampager for Doctrine 2
Rapid pagination for Doctrine 2
Requirements
- PHP:
^8.2
- doctrine/orm:
^2.20
- lampager/lampager:
^0.5
[!NOTE] Older versions have outdated dependency requirements. If you cannot prepare the latest environment, please refer to past releases.
Installing
Usage
Basic
Instantiate your QueryBuilder to create the Paginator.
It will run the optimized DQL.
And you'll get
Advanced: Provide mapping for aliased columns and switch to different Hydration Mode
Questions
Seekable(Bidirectional) Query?
Sorry you can't use seekable mode since Doctrine DQL does not support UNION ALL
syntax. :cry:
How about Tuple Comparison?
Doctrine DQL does not support Tuple Comparison syntax! :cry:
Classes
Note: See also lampager/lampager.
Name | Type | Parent Class | Description |
---|---|---|---|
Lampager\Doctrine2\Paginator |
Class | Lampager\Paginator |
Fluent factory implementation for Doctrine 2 |
Lampager\Doctrine2\Processor |
Class | Lampager\AbstractProcessor |
Processor implementation for Doctrine 2 |
Lampager\Doctrine2\Compiler |
Class | Compile Lampager Query into Doctrine QueryBuilder |
API
Note: See also lampager/lampager.
Paginator::__construct()
Paginator::create()
Create a new paginator instance.
Paginator::setMapping()
Arguments
(string[])
$mapping
An associative array that contains$columnNameOrCursorKey => $fetchedFieldName
.
Paginator::aggregated()
Declare that HAVING
should be used instead of WHERE
for aggregation.
Paginator::setMaxResults()
Alias for \Lampager\Paginator::limit()
.
Paginator::transform()
Transform Lampager Query into Doctrine Query.
Paginator::build()
Perform configure + transform.
Paginator::paginate()
Perform configure + transform + process.
Arguments
(mixed)
$cursor
An associative array that contains$column => $value
or an object that implements\Lampager\Contracts\Cursor
. It must be all-or-nothing.- For initial page, omit this parameter or pass empty array.
- For subsequent pages, pass all parameters. Partial parameters are not allowd.