@@ -1050,13 +1050,13 @@ App\Entity\Offer:
10501050When the property used for ordering can contain `null` values, you may want to specify how `null` values are treated in
10511051the comparison :
10521052
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`) |
10601060
10611061For instance, treat entries with a property value of `null` as the smallest, with the following service definition :
10621062
@@ -1067,12 +1067,13 @@ For instance, treat entries with a property value of `null` as the smallest, wit
10671067// api/src/Entity/Offer.php
10681068namespace App\E ntity;
10691069
1070+ use ApiPlatform\D octrine\C ommon\F ilter\O rderFilterInterface;
10701071use ApiPlatform\M etadata\A piFilter;
10711072use ApiPlatform\M etadata\A piResource;
10721073use ApiPlatform\D octrine\O rm\F ilter\O rderFilter;
10731074
10741075#[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']])]
10761077class Offer
10771078{
10781079 // ...
0 commit comments