@@ -1855,7 +1855,7 @@ Multiple parameters targeting the same relation path share the same JOIN (ORM) o
18551855# ## Nested Properties with the Legacy ApiFilter Syntax (deprecated)
18561856
18571857> [!WARNING] The legacy method using the `ApiFilter` attribute is **deprecated** and scheduled for
1858- > **removal** in API Platform **5 .0**. We strongly recommend migrating to the new `QueryParameter`
1858+ > **removal** in API Platform **6 .0**. We strongly recommend migrating to the new `QueryParameter`
18591859> syntax described above.
18601860
18611861For legacy code, the built-in filters that extend `AbstractFilter` support nested properties using
@@ -1921,7 +1921,7 @@ The above allows you to find offers by their respective product's color:
19211921# # Enabling a Filter for All Properties of a Resource
19221922
19231923> [!WARNING] The legacy method using the `ApiFilter` attribute is **deprecated** and scheduled for
1924- > **removal** in API Platform **5 .0**. We strongly recommend migrating to the new `QueryParameter`
1924+ > **removal** in API Platform **6 .0**. We strongly recommend migrating to the new `QueryParameter`
19251925> syntax, which is detailed in the [Introduction](#introduction). You can use the `:property`
19261926> placeholder instead and it is recommended to use a filter for each type of data you are filtering.
19271927
@@ -2287,7 +2287,7 @@ use Doctrine\ORM\QueryBuilder;
22872287
22882288class MyCustomFilter implements FilterInterface
22892289{
2290- use BackwardCompatibleFilterDescriptionTrait; // Here for backward compatibility, keep it until 5 .0.
2290+ use BackwardCompatibleFilterDescriptionTrait; // Here for backward compatibility, keep it until 6 .0.
22912291
22922292 public function apply(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void
22932293 {
@@ -2308,6 +2308,12 @@ class MyCustomFilter implements FilterInterface
23082308}
23092309` ` `
23102310
2311+ ` BackwardCompatibleFilterDescriptionTrait` supplies a `getDescription()` method that returns an
2312+ empty array, satisfying the legacy `FilterInterface::getDescription()` requirement without you
2313+ having to implement it by hand. It lets a custom filter keep working with the deprecated filter
2314+ chain while you migrate it to `#[QueryParameter]`, and it will be removed in API Platform 6.0
2315+ together with `getDescription()` itself.
2316+
23112317# ### Implementing a Custom ORM Filter
23122318
23132319Let's create a concrete filter that allows fetching entities based on the month of a date field (for
@@ -2334,7 +2340,7 @@ use Doctrine\ORM\QueryBuilder;
23342340
23352341class MonthFilter implements FilterInterface
23362342{
2337- use BackwardCompatibleFilterDescriptionTrait; // Here for backward compatibility, keep it until 5 .0.
2343+ use BackwardCompatibleFilterDescriptionTrait; // Here for backward compatibility, keep it until 6 .0.
23382344
23392345 public function apply(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void
23402346 {
@@ -2578,7 +2584,7 @@ use Doctrine\ODM\MongoDB\Aggregation\Builder;
25782584
25792585class MonthFilter implements FilterInterface
25802586{
2581- use BackwardCompatibleFilterDescriptionTrait; // Here for backward compatibility, keep it until 5 .0.
2587+ use BackwardCompatibleFilterDescriptionTrait; // Here for backward compatibility, keep it until 6 .0.
25822588
25832589 public function apply(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void
25842590 {
@@ -2620,7 +2626,7 @@ use Doctrine\ODM\MongoDB\Aggregation\Builder;
26202626
26212627class MonthFilter implements FilterInterface
26222628{
2623- use BackwardCompatibleFilterDescriptionTrait; // Here for backward compatibility, keep it until 5 .0.
2629+ use BackwardCompatibleFilterDescriptionTrait; // Here for backward compatibility, keep it until 6 .0.
26242630
26252631 public function apply(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void
26262632 {
0 commit comments