Download the PHP package ifedko/php-doctrine-dbal-pagination without Composer
On this page you can find all versions of the php package ifedko/php-doctrine-dbal-pagination. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ifedko/php-doctrine-dbal-pagination
More information about ifedko/php-doctrine-dbal-pagination
Files in ifedko/php-doctrine-dbal-pagination
Package php-doctrine-dbal-pagination
Short Description Php pagination builder using doctrine dbal
License MIT
Informations about the package php-doctrine-dbal-pagination
PHP DOCTRINE DBAL pagination
The goal
Everyone faces the task when it's required to get list of items by customizable filters, to sort by customizable parameters and paginate these items. This library helps to do it.
Usage
GETTING STARTED
Examples work with table users
(id
, is_active
, name
, created_at
).
At first create your builder. It's necessary to define base query there:
Then use the builder:
where
$limit
is a count of items on page (20
by default)
$offset
is a number of start row (0
by default)
FILTERING
Add configureFilters
method to your MyListBuilder
class to use customizable filtering.
This examples explains how to turn on filters by certain fields: id
, name
, created_at
where
parameters
is array which can contain parameters for filter (see using the builder above)
EqualFilter
, GreaterThanOrEqualFilter
and LessThanOrEqualFilter
are some of available filters (see below about all filters)
For example,
SORTING
Add configureSorting
method to your MyListBuilder
class:
where
parameters
is array which can contain parameters for sorting (see using the builder above)
For example,
FILTERS
- DateRangeFilter
- EqualFilter
- GreaterThanOrEqualFilter
- LessThanOrEqualFilter
- LikeFilter
- MultipleEqualFilter
- MultipleLikeFilter
MultipleLikeFilter
This filter supports complex search queries, like substrings separated by a space. It narrows results when more search words is provided. Also negotiation is possible, like '-word'.
example:
search: bla
results (3):
c1 | c2 |
---|---|
bla | first |
bla | second |
bla | final |
search: bla fi
results (2):
c1 | c2 |
---|---|
bla | first |
bla | final |
search: bla fi -final
results (1):
c1 | c2 |
---|---|
bla | first |
Options
It is possible to define the options:
- operator - comparison operator, ILIKE, for example
- matchFromStart - array of columns to do match from start of the string,
col like 'substring%'
for example