1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* |
4
|
|
|
* This file is part of Aura for PHP. |
5
|
|
|
* |
6
|
|
|
* @license http://opensource.org/licenses/MIT MIT |
7
|
|
|
* |
8
|
|
|
*/ |
9
|
|
|
namespace Aura\Payload; |
10
|
|
|
|
11
|
|
|
use Aura\Payload_Interface\PayloadInterface; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* |
15
|
|
|
* A domain payload object. |
16
|
|
|
* |
17
|
|
|
* @package Aura.Payload |
18
|
|
|
* |
19
|
|
|
*/ |
20
|
|
|
class Payload implements PayloadInterface |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* |
24
|
|
|
* The payload status. |
25
|
|
|
* |
26
|
|
|
* @var mixed |
27
|
|
|
* |
28
|
|
|
*/ |
29
|
|
|
protected $status; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* |
33
|
|
|
* The domain input. |
34
|
|
|
* |
35
|
|
|
* @var mixed |
36
|
|
|
* |
37
|
|
|
*/ |
38
|
|
|
protected $input; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* |
42
|
|
|
* The domain output. |
43
|
|
|
* |
44
|
|
|
* @var mixed |
45
|
|
|
* |
46
|
|
|
*/ |
47
|
|
|
protected $output; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* |
51
|
|
|
* Messages reported by the domain. |
52
|
|
|
* |
53
|
|
|
* @var mixed |
54
|
|
|
* |
55
|
|
|
*/ |
56
|
|
|
protected $messages; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* |
60
|
|
|
* Arbitrary extra information from the domain. |
61
|
|
|
* |
62
|
|
|
* @var mixed |
63
|
|
|
* |
64
|
|
|
*/ |
65
|
|
|
protected $extras; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* |
69
|
|
|
* Sets the payload status. |
70
|
|
|
* |
71
|
|
|
* @param mixed $status The payload status. |
72
|
|
|
* |
73
|
|
|
* @return self |
74
|
|
|
* |
75
|
|
|
*/ |
76
|
1 |
|
public function setStatus($status) |
77
|
|
|
{ |
78
|
1 |
|
$this->status = $status; |
79
|
1 |
|
return $this; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* |
84
|
|
|
* Gets the payload status. |
85
|
|
|
* |
86
|
|
|
* @return mixed |
87
|
|
|
* |
88
|
|
|
*/ |
89
|
1 |
|
public function getStatus() |
90
|
|
|
{ |
91
|
1 |
|
return $this->status; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* |
96
|
|
|
* Sets the domain input. |
97
|
|
|
* |
98
|
|
|
* @param mixed $input The domain input. |
99
|
|
|
* |
100
|
|
|
* @return self |
101
|
|
|
* |
102
|
|
|
*/ |
103
|
1 |
|
public function setInput($input) |
104
|
|
|
{ |
105
|
1 |
|
$this->input = $input; |
106
|
1 |
|
return $this; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* |
111
|
|
|
* Gets the domain input. |
112
|
|
|
* |
113
|
|
|
* @return mixed |
114
|
|
|
* |
115
|
|
|
*/ |
116
|
1 |
|
public function getInput() |
117
|
|
|
{ |
118
|
1 |
|
return $this->input; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* |
123
|
|
|
* Sets the domain output. |
124
|
|
|
* |
125
|
|
|
* @param mixed $output The domain output. |
126
|
|
|
* |
127
|
|
|
* @return self |
128
|
|
|
* |
129
|
|
|
*/ |
130
|
1 |
|
public function setOutput($output) |
131
|
|
|
{ |
132
|
1 |
|
$this->output = $output; |
133
|
1 |
|
return $this; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* |
138
|
|
|
* Gets the domain output. |
139
|
|
|
* |
140
|
|
|
* @return mixed |
141
|
|
|
* |
142
|
|
|
*/ |
143
|
1 |
|
public function getOutput() |
144
|
|
|
{ |
145
|
1 |
|
return $this->output; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* |
150
|
|
|
* Sets the domain messages. |
151
|
|
|
* |
152
|
|
|
* @param mixed $messages The domain messages. |
153
|
|
|
* |
154
|
|
|
* @return self |
155
|
|
|
* |
156
|
|
|
*/ |
157
|
1 |
|
public function setMessages($messages) |
158
|
|
|
{ |
159
|
1 |
|
$this->messages = $messages; |
160
|
1 |
|
return $this; |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* |
165
|
|
|
* Gets the domain messages. |
166
|
|
|
* |
167
|
|
|
* @return mixed |
168
|
|
|
* |
169
|
|
|
*/ |
170
|
1 |
|
public function getMessages() |
171
|
|
|
{ |
172
|
1 |
|
return $this->messages; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* |
177
|
|
|
* Sets arbitrary extra domain information. |
178
|
|
|
* |
179
|
|
|
* @param mixed $extras The domain extras. |
180
|
|
|
* |
181
|
|
|
* @return self |
182
|
|
|
* |
183
|
|
|
*/ |
184
|
1 |
|
public function setExtras($extras) |
185
|
|
|
{ |
186
|
1 |
|
$this->extras = $extras; |
187
|
1 |
|
return $this; |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* |
192
|
|
|
* Gets the arbitrary extra domain information. |
193
|
|
|
* |
194
|
|
|
* @return mixed |
195
|
|
|
* |
196
|
|
|
*/ |
197
|
1 |
|
public function getExtras() |
198
|
|
|
{ |
199
|
1 |
|
return $this->extras; |
200
|
|
|
} |
201
|
|
|
} |
202
|
|
|
|