10
10
11
11
namespace Test \Request ;
12
12
13
+ use Test \Schema \ResourceFilter ;
13
14
use Test \Schema \SerializableInterface ;
14
15
15
16
class GetResourcesRequest implements RequestInterface
@@ -20,6 +21,8 @@ class GetResourcesRequest implements RequestInterface
20
21
21
22
private ?array $ filterByIds = null ;
22
23
24
+ private ?ResourceFilter $ filter = null ;
25
+
23
26
private string $ contentType = '' ;
24
27
25
28
public function getContentType (): string
@@ -51,6 +54,13 @@ public function setFilterByIds(array $filterByIds): self
51
54
return $ this ;
52
55
}
53
56
57
+ public function setFilter (ResourceFilter $ filter ): self
58
+ {
59
+ $ this ->filter = $ filter ;
60
+
61
+ return $ this ;
62
+ }
63
+
54
64
public function getMethod (): string
55
65
{
56
66
return 'GET ' ;
@@ -65,14 +75,14 @@ public function getQueryParameters(): array
65
75
{
66
76
return \array_map (static function ($ value ) {
67
77
return $ value instanceof SerializableInterface ? $ value ->toArray () : $ value ;
68
- }, \array_filter (['filterById ' => $ this ->filterById , 'filterByName ' => $ this ->filterByName , 'filterByIds ' => $ this ->filterByIds ], static function ($ value ) {
78
+ }, \array_filter (['filterById ' => $ this ->filterById , 'filterByName ' => $ this ->filterByName , 'filterByIds ' => $ this ->filterByIds , ' filter ' => $ this -> filter ], static function ($ value ) {
69
79
return null !== $ value ;
70
80
}));
71
81
}
72
82
73
83
public function getRawQueryParameters (): array
74
84
{
75
- return ['filterById ' => $ this ->filterById , 'filterByName ' => $ this ->filterByName , 'filterByIds ' => $ this ->filterByIds ];
85
+ return ['filterById ' => $ this ->filterById , 'filterByName ' => $ this ->filterByName , 'filterByIds ' => $ this ->filterByIds , ' filter ' => $ this -> filter ];
76
86
}
77
87
78
88
public function getCookies (): array
0 commit comments