From fb2591f5b37afefc13c636f3833bc6c5e08fdbc9 Mon Sep 17 00:00:00 2001 From: Kai Dederichs Date: Tue, 22 Mar 2022 13:08:37 +0100 Subject: [PATCH] Describe UuidRangeFilter --- core/filters.md | 22 ++++++++++++++++++++++ core/pagination.md | 30 +++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/core/filters.md b/core/filters.md index 0a7868e06b0..410ae1fa82e 100644 --- a/core/filters.md +++ b/core/filters.md @@ -519,6 +519,28 @@ It will return all offers with `price` between 12.99 and 15.99. You can filter offers by joining two values, for example: `/offers?price[gt]=12.99&price[lt]=19.99`. +### Uuid Range Filter + +In case you want to filter based on UUIDs (V1 and V6) you'll need to use the `UuidRangeFilter` instead of the `RangeFilter`. +The syntax and behaviour is the same as the normal `RangeFilter`: + +```php + 'id', 'direction' => 'DESC'] + ] +)] +#[ApiFilter(UuidRangeFilter::class, properties: ["id"])] +#[ApiFilter(OrderFilter::class, properties: ["id" => "DESC"])] +class Book +{ + // ... +} +``` + To know more about cursor-based pagination take a look at [this blog post on medium (draft)](https://medium.com/@sroze/74fd1d324723). ## Controlling The Behavior of The Doctrine ORM Paginator