@@ -1050,13 +1050,13 @@ App\Entity\Offer:
1050
1050
When the property used for ordering can contain `null` values, you may want to specify how `null` values are treated in
1051
1051
the comparison :
1052
1052
1053
- | Description | Strategy to set |
1054
- | ------------------------------------ | ---------------------------------------------------------------------------------------- |
1055
- | Use the default behavior of the DBMS | `null` |
1056
- | Consider items as smallest | `ApiPlatform\Doctrine\Orm \Filter\OrderFilter ::NULLS_SMALLEST` (`nulls_smallest`) |
1057
- | Consider items as largest | `ApiPlatform\Doctrine\Orm \Filter\OrderFilter ::NULLS_LARGEST` (`nulls_largest`) |
1058
- | Order items always first | `ApiPlatform\Doctrine\Orm \Filter\OrderFilter ::NULLS_ALWAYS_FIRST` (`nulls_always_first`) |
1059
- | Order items always last | `ApiPlatform\Doctrine\Orm \Filter\OrderFilter ::NULLS_ALWAYS_LAST` (`nulls_always_last`) |
1053
+ | Description | Strategy to set |
1054
+ | ------------------------------------ |--------------------------------------------------------------------------------------------------- |
1055
+ | Use the default behavior of the DBMS | `null` |
1056
+ | Consider items as smallest | `ApiPlatform\Doctrine\Common \Filter\OrderFilterInterface ::NULLS_SMALLEST` (`nulls_smallest`) |
1057
+ | Consider items as largest | `ApiPlatform\Doctrine\Common \Filter\OrderFilterInterface ::NULLS_LARGEST` (`nulls_largest`) |
1058
+ | Order items always first | `ApiPlatform\Doctrine\Common \Filter\OrderFilterInterface ::NULLS_ALWAYS_FIRST` (`nulls_always_first`) |
1059
+ | Order items always last | `ApiPlatform\Doctrine\Common \Filter\OrderFilterInterface ::NULLS_ALWAYS_LAST` (`nulls_always_last`) |
1060
1060
1061
1061
For instance, treat entries with a property value of `null` as the smallest, with the following service definition :
1062
1062
@@ -1067,12 +1067,13 @@ For instance, treat entries with a property value of `null` as the smallest, wit
1067
1067
// api/src/Entity/Offer.php
1068
1068
namespace App\E ntity;
1069
1069
1070
+ use ApiPlatform\D octrine\C ommon\F ilter\O rderFilterInterface;
1070
1071
use ApiPlatform\M etadata\A piFilter;
1071
1072
use ApiPlatform\M etadata\A piResource;
1072
1073
use ApiPlatform\D octrine\O rm\F ilter\O rderFilter;
1073
1074
1074
1075
#[ApiResource]
1075
- #[ApiFilter(OrderFilter::class, properties: ['validFrom' => ['nulls_comparison' => OrderFilter ::NULLS_SMALLEST, 'default_direction' => 'DESC']])]
1076
+ #[ApiFilter(OrderFilter::class, properties: ['validFrom' => ['nulls_comparison' => OrderFilterInterface ::NULLS_SMALLEST, 'default_direction' => 'DESC']])]
1076
1077
class Offer
1077
1078
{
1078
1079
// ...
0 commit comments