You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add missing function return type in filters.md (#1791)
* Update function return type in filters.md
* docs: various fixes in filters.md
* Update filters.md
---------
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
The value can take any date format supported by the [`\DateTime` constructor](https://www.php.net/manual/en/datetime.construct.php).
262
262
263
263
The `after` and `before` filters will filter including the value whereas `strictly_after` and `strictly_before` will filter excluding the value.
264
264
265
-
Like others filters, the date filter must be explicitly enabled:
265
+
Like other filters, the date filter must be explicitly enabled:
266
266
267
267
[codeSelector]
268
268
@@ -533,7 +533,7 @@ You can filter offers by joining two values, for example: `/offers?price[gt]=12.
533
533
534
534
### Exists Filter
535
535
536
-
The exists filter allows you to select items based on a nullable field value.
536
+
The "exists" filter allows you to select items based on a nullable field value.
537
537
It will also check the emptiness of a collection association.
538
538
539
539
Syntax: `?exists[property]=<true|false|1|0>`
@@ -582,7 +582,7 @@ App\Entity\Offer:
582
582
583
583
[/codeSelector]
584
584
585
-
Given that the collection endpoint is `/offers`, you can filter offers on nullable field with the following query: `/offers?exists[transportFees]=true`.
585
+
Given that the collection endpoint is `/offers`, you can filter offers on the nullable field with the following query: `/offers?exists[transportFees]=true`.
586
586
587
587
It will return all offers where `transportFees` is not `null`.
588
588
@@ -600,7 +600,7 @@ api_platform:
600
600
601
601
### Order Filter (Sorting)
602
602
603
-
The order filter allows to sort a collection against the given properties.
603
+
The order filter allows sorting a collection against the given properties.
604
604
605
605
Syntax: `?order[property]=<asc|desc>`
606
606
@@ -990,8 +990,8 @@ api_platform:
990
990
991
991
### Match Filter
992
992
993
-
The match filter allows to find resources that [match](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html)
994
-
the specified text on fulltext fields.
993
+
The match filter allows us to find resources that [match](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html)
994
+
the specified text on full-text fields.
995
995
996
996
Syntax: `?property[]=value`
997
997
@@ -1021,7 +1021,7 @@ Given that the collection endpoint is `/tweets`, you can filter tweets by messag
1021
1021
1022
1022
### Term Filter
1023
1023
1024
-
The term filter allows to find resources that contain the exact specified
1024
+
The term filter allows us to find resources that contain the exact specified
foreach(array_keys($this->getProperties()) as $prop) { //NOTE: we use array_keys because getProperties() returns a map of property => strategy
1310
+
foreach(array_keys($this->getProperties()) as $prop) { // we use array_keys() because getProperties() returns a map of property => strategy
1310
1311
if (!$this->isPropertyEnabled($prop, $resourceClass) || !$this->isPropertyMapped($prop, $resourceClass)) {
1311
1312
return;
1312
1313
}
@@ -1335,7 +1336,7 @@ services:
1335
1336
tags: [ 'api_platform.filter' ]
1336
1337
```
1337
1338
1338
-
In the previous example, the filter can be applied on any property. However, thanks to the `AbstractFilter` class,
1339
+
In the previous example, the filter can be applied to any property. However, thanks to the `AbstractFilter` class,
1339
1340
it can also be enabled for some properties:
1340
1341
1341
1342
```yaml
@@ -1416,7 +1417,7 @@ class AndOperatorFilterExtension implements RequestBodySearchCollectionExtension
1416
1417
### Using Doctrine ORM Filters
1417
1418
1418
1419
Doctrine ORM features [a filter system](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/filters.html) that allows the developer to add SQL to the conditional clauses of queries, regardless of the place where the SQL is generated (e.g. from a DQL query, or by loading associated entities).
1419
-
These are applied on collections and items and therefore are incredibly useful.
1420
+
These are applied to collections and items and therefore are incredibly useful.
1420
1421
1421
1422
The following information, specific to Doctrine filters in Symfony, is based upon [a great article posted on Michaël Perrin's blog](http://blog.michaelperrin.fr/2014/12/05/doctrine-filters/).
1422
1423
@@ -1595,7 +1596,7 @@ On the first property, `name`, it's straightforward. The first attribute argumen
In the second attribute, we specify `properties` on which the filter should apply. It's necessary here because we don't want to filter `colors` but the `prop` property of the `colors` association.
1599
+
In the second attribute, we specify `properties` to which the filter should apply. It's necessary here because we don't want to filter `colors` but the `prop` property of the `colors` association.
1599
1600
Note that for each given property we specify the strategy:
1600
1601
1601
1602
```php
@@ -1633,7 +1634,7 @@ class DummyCar
1633
1634
1634
1635
```
1635
1636
1636
-
The `BooleanFilter` is applied to every `Boolean` property of the class. Indeed, in each core filter we check the Doctrine type. It's written only by using the filter class:
1637
+
The `BooleanFilter` is applied to every `Boolean` property of the class. Indeed, in each core filter, we check the Doctrine type. It's written only by using the filter class:
0 commit comments