1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Schema Class for output data. |
4
|
|
|
*/ |
5
|
|
|
namespace Graviton\ProxyApiBundle\Model; |
6
|
|
|
|
7
|
|
|
use Graviton\ProxyApiBundle\Processor\PostProcessorInterface; |
8
|
|
|
use Graviton\ProxyApiBundle\Processor\PreProcessorInterface; |
9
|
|
|
use Graviton\ProxyApiBundle\Processor\ProxyProcessorInterface; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Schema |
13
|
|
|
* |
14
|
|
|
* @author List of contributors <https://github.com/libgraviton/graviton/graphs/contributors> |
15
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License |
16
|
|
|
* @link http://swisscom.ch |
17
|
|
|
*/ |
18
|
|
|
class ProxyModel |
19
|
|
|
{ |
20
|
|
|
protected $name = ''; |
21
|
|
|
protected $uri = ''; |
22
|
|
|
protected $serviceEndpoint = ''; |
23
|
|
|
protected $queryAdditionals = []; |
24
|
|
|
protected $queryParams = []; |
25
|
|
|
|
26
|
|
|
/** @var PreProcessorInterface */ |
27
|
|
|
protected $preProcessorService; |
28
|
|
|
protected $proxyProcessorService; |
29
|
|
|
protected $postProcessorService; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @return string |
33
|
|
|
*/ |
34
|
|
|
public function getName() |
35
|
|
|
{ |
36
|
|
|
return $this->name; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @param string $name setter |
41
|
|
|
* @return void |
42
|
|
|
*/ |
43
|
|
|
public function setName($name) |
44
|
|
|
{ |
45
|
|
|
$this->name = $name; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return mixed |
|
|
|
|
50
|
|
|
*/ |
51
|
|
|
public function getUri() |
52
|
|
|
{ |
53
|
|
|
return $this->uri; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @param mixed $uri setter |
58
|
|
|
* @return void |
59
|
|
|
*/ |
60
|
|
|
public function setUri($uri) |
61
|
|
|
{ |
62
|
|
|
$this->uri = $uri; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @return mixed |
|
|
|
|
67
|
|
|
*/ |
68
|
|
|
public function getServiceEndpoint() |
69
|
|
|
{ |
70
|
|
|
return $this->serviceEndpoint; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @param mixed $serviceEndpoint setter |
75
|
|
|
* @return void |
76
|
|
|
*/ |
77
|
|
|
public function setServiceEndpoint($serviceEndpoint) |
78
|
|
|
{ |
79
|
|
|
$this->serviceEndpoint = $serviceEndpoint; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Object Processor |
84
|
|
|
* |
85
|
|
|
* @return PreProcessorInterface setter |
86
|
|
|
*/ |
87
|
|
|
public function getPreProcessorService() |
88
|
|
|
{ |
89
|
|
|
return $this->preProcessorService; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @param PreProcessorInterface $preProcessorService setter |
94
|
|
|
* @return void |
95
|
|
|
*/ |
96
|
|
|
public function setPreProcessorService(PreProcessorInterface $preProcessorService) |
97
|
|
|
{ |
98
|
|
|
$this->preProcessorService = $preProcessorService; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* Object Processor |
103
|
|
|
* |
104
|
|
|
* @return ProxyProcessorInterface |
105
|
|
|
*/ |
106
|
|
|
public function getProxyProcessorService() |
107
|
|
|
{ |
108
|
|
|
return $this->proxyProcessorService; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @param ProxyProcessorInterface $proxyProcessorService setter |
113
|
|
|
* @return void |
114
|
|
|
*/ |
115
|
|
|
public function setProxyProcessorService($proxyProcessorService) |
116
|
|
|
{ |
117
|
|
|
$this->proxyProcessorService = $proxyProcessorService; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* Object Processor |
122
|
|
|
* |
123
|
|
|
* @return PostProcessorInterface |
124
|
|
|
*/ |
125
|
|
|
public function getPostProcessorService() |
126
|
|
|
{ |
127
|
|
|
return $this->postProcessorService; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @param PostProcessorInterface $postProcessorService setter |
132
|
|
|
* @return void |
133
|
|
|
*/ |
134
|
|
|
public function setPostProcessorService($postProcessorService) |
135
|
|
|
{ |
136
|
|
|
$this->postProcessorService = $postProcessorService; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @return array |
141
|
|
|
*/ |
142
|
|
|
public function getQueryAdditionals() |
143
|
|
|
{ |
144
|
|
|
return $this->queryAdditionals; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @param array $queryAdditionals Optional added query params |
149
|
|
|
* @return void |
150
|
|
|
*/ |
151
|
|
|
public function setQueryAdditionals($queryAdditionals) |
152
|
|
|
{ |
153
|
|
|
$this->queryAdditionals = $queryAdditionals; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @return array |
158
|
|
|
*/ |
159
|
|
|
public function getQueryParams() |
160
|
|
|
{ |
161
|
|
|
return $this->queryParams; |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* @param array $queryParams Unique request params |
166
|
|
|
* @return void |
167
|
|
|
*/ |
168
|
|
|
public function setQueryParams($queryParams) |
169
|
|
|
{ |
170
|
|
|
$this->queryParams = $queryParams; |
171
|
|
|
} |
172
|
|
|
} |
173
|
|
|
|
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.