@@ -213,14 +213,18 @@ use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter;
213
213
214
214
/**
215
215
* @ApiResource
216
- * @ApiFilter(DateFilter::class, properties={"dateProperty "})
216
+ * @ApiFilter(DateFilter::class, properties={"createdAt "})
217
217
*/
218
218
class Offer
219
219
{
220
220
// ...
221
221
}
222
222
` ` `
223
223
224
+ Given that the collection endpoint is `/offers`, you can filter offers by date with the following query : ` /offers?createdAt[after]=2018-03-19` .
225
+
226
+ It will return all offers where `createdAt` is superior or equal to `2018-03-19`.
227
+
224
228
# ### Managing `null` Values
225
229
226
230
The date filter is able to deal with date properties having `null` values.
@@ -259,7 +263,7 @@ class Offer
259
263
260
264
The boolean filter allows you to search on boolean fields and values.
261
265
262
- Syntax : ` ?property=[ true|false|1|0] `
266
+ Syntax : ` ?property=< true|false|1|0> `
263
267
264
268
Enable the filter :
265
269
@@ -291,7 +295,7 @@ It will return all offers where `isAvailableGenericallyInMyCountry` equals `true
291
295
292
296
The numeric filter allows you to search on numeric fields and values.
293
297
294
- Syntax : ` ?property=int|bigint|decimal...`
298
+ Syntax : ` ?property=< int|bigint|decimal...> `
295
299
296
300
Enable the filter :
297
301
@@ -323,7 +327,7 @@ It will return all offers with `sold` equals `1`.
323
327
324
328
The range filter allows you to filter by a value Lower than, Greater than, Lower than or equal, Greater than or equal and between two values.
325
329
326
- Syntax : ` ?property[lt]|[gt]|[ lte]|[ gte]|[ between]=value`
330
+ Syntax : ` ?property[<lt|gt| lte| gte| between> ]=value`
327
331
328
332
Enable the filter :
329
333
0 commit comments