File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -951,6 +951,27 @@ class Offer
951
951
}
952
952
` ` `
953
953
954
+ When using `ApiFilter` annotation, you can specify specific properties for which the filter will be applied :
955
+ ` ` `
956
+ <?php
957
+ // api/src/Entity/Offer.php
958
+
959
+ namespace App\E ntity;
960
+
961
+ use ApiPlatform\C ore\A nnotation\A piFilter;
962
+ use ApiPlatform\C ore\A nnotation\A piResource;
963
+ use App\F ilter\R egexpFilter;
964
+
965
+ /**
966
+ * @ApiResource
967
+ * @ApiFilter(RegexpFilter::class, properties={"email","anOtherProperty"})
968
+ */
969
+ class Offer
970
+ {
971
+ // ...
972
+ }
973
+ ` ` `
974
+
954
975
You can now enable this filter using URLs like `http://example.com/offers?regexp_email=^[FOO]`. This new filter will also
955
976
appear in Swagger and Hydra documentations.
956
977
You can’t perform that action at this time.
0 commit comments