Download the PHP package lampager/lampager-idiorm without Composer
On this page you can find all versions of the php package lampager/lampager-idiorm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lampager/lampager-idiorm
More information about lampager/lampager-idiorm
Files in lampager/lampager-idiorm
Package lampager-idiorm
Short Description Rapid pagination for Idiorm and Paris
License MIT
Informations about the package lampager-idiorm
Lampager for Idiorm and Paris
Rapid pagination without using OFFSET
Requirements
- PHP:
>=5.6
- j4mie/idiorm:
^5.4
, j4mie/paris:^1.5
- lampager/lampager:
^0.4
Installing
Basic Usage
You can wrap ORM
instance with global function lampager()
to make it chainable.
It will run the optimized query.
And you'll get
Question: How about Tuple Comparison?
With this feature, SQL statements should be simpler. However, according to SQL Feature Comparison, some RDBMS, such as SQLServer, do not support this syntax. Therefore, Lampager continuously uses redundant statements.
Classes
Note: See also lampager/lampager.
Name | Type | Parent Class | Description |
---|---|---|---|
Lampager\Idiorm\Paginator |
Class | Lampager\Paginator |
Fluent factory implementation for Idiorm and Paris |
Lampager\Idiorm\Processor |
Class | Lampager\AbstractProcessor |
Processor implementation for Idiorm and Paris |
Lampager\Idiorm\PaginationResult |
Class | Lampager\PaginationResult |
PaginationResult implementation for Idiorm and Paris |
- All camelCase methods in
Paginator
,Processor
andPaginationResult
can be invoked by snake_case style.
API
Note: See also lampager/lampager.
Paginator::__construct()
Paginator::create()
Create a new paginator instance.
If you use global function lampager()
, however, you don't need to directly instantiate.
Paginator::transform()
Transform Lampager Query into Illuminate builder.
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.
Return Value
e.g.
Paginator::useFormatter()
Paginator::restoreFormatter()
Paginator::process()
Invoke Processor methods.
PaginationResult::toArray()
PaginationResult::jsonSerialize()
Convert the object into array.
IMPORTANT: camelCase properties are converted into snake_case form.
PaginationResult::__call()
Call IdiormResultSet
methods.