Files
Chamilo/vendor/knplabs/knp-components/doc/pager/config.md
T
Xes 73154ae174
Behat tests 1.11.x 🐞 / PHP 7.4 Test on ubuntu-latest (push) Canceled after 0s
PHP-CS-Fixer / composer_install (7.4) (push) Canceled after 0s
Chamilo 1.11.40 (ZIP oficial v1.11.40)
Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip
sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439
Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
2026-08-06 17:59:45 +02:00

55 lines
2.9 KiB
Markdown

## Configuration
Some subscribers will take into account some options.
These options can be passed as the 4th argument of `Paginator::paginate()`.
For example, Doctrine ORM subscriber will generate different sql queries if the `distinct` options changes.
The list of existing options are:
| name | type | default value | subscribers |
| -------------------------- | -------------- | ------------- | ----------------------------------------------- |
| wrap-queries | bool | false | orm QuerySubscriber, orm QueryBuilderSubscriber |
| distinct | bool | true | QuerySubscriber, QueryBuilderSubscriber |
| pageParameterName | string | page | SortableSubscriber |
| defaultSortFieldName | string\|array* | | SortableSubscriber |
| defaultSortDirection | string | asc | SortableSubscriber |
| sortFieldWhitelist | array | [] | SortableSubscriber |
| sortFieldParameterName | string | sort | SortableSubscriber |
| sortDirectionParameterName | string | direction | SortableSubscriber |
| defaultFilterFields | string\|array* | | FiltrationSubscriber |
| filterFieldWhitelist | array | | FiltrationSubscriber |
| filterFieldParameterName | string | filterParam | FiltrationSubscriber |
| filterValueParameterName | string | filterValue | FiltrationSubscriber |
## Noticeable behaviors of some options
### `distinct`
If set to true, will add a distinct sql keyword on orm queries to ensuire unicity of counted results
### `wrap-queries`
If set to true, will take advantage of doctrine 2.3 output walkers by using subqueries to handle composite keys and HAVING queries.
This can considerably impact performances depending on the query and the platform, you will have to consider it at some point.
If you want to order your results by a column from a fetch joined t-many association,
you have to set `wrap-queries` to `true`. Otherwise you will get an exception with this warning:
*"Cannot select distinct identifiers from query with LIMIT and ORDER BY on a column from a fetch joined to-many association. Use output walkers."*
### `defaultSortFieldName`
Used as default field name for the sorting. It can take an array for sorting by multiple fields.
\* **Attention**: Arrays are only supported for *Doctrine's ORM*.
### `defaultFilterFields`
Used as default field names for the filtration. It can take an array for filtering by multiple fields.