1 | <?php |
||
10 | final class DataWrapper implements DataWrapperInterface |
||
11 | { |
||
12 | /** |
||
13 | * The HTTP status code of the returned result. |
||
14 | * |
||
15 | * @var integer |
||
16 | */ |
||
17 | private $code; |
||
18 | |||
19 | /** |
||
20 | * A string description of the call status. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | private $status; |
||
25 | |||
26 | /** |
||
27 | * The copyright notice for the returned result. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | private $copyright; |
||
32 | |||
33 | /** |
||
34 | * The attribution notice for this result |
||
35 | * |
||
36 | * @var string |
||
37 | */ |
||
38 | private $attributionText; |
||
39 | |||
40 | /** |
||
41 | * An HTML representation of the attribution notice for this result. |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | private $attributionHTML; |
||
46 | |||
47 | /** |
||
48 | * A digest value of the content returned by the call. |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | private $etag; |
||
53 | |||
54 | /** |
||
55 | * The results returned by the call. |
||
56 | * |
||
57 | * @var DataContainerInterface |
||
58 | */ |
||
59 | private $data; |
||
60 | |||
61 | /** |
||
62 | * Create a new DataWrapper instance. |
||
63 | * |
||
64 | * @param array $input The data for the DataWrapper. |
||
65 | */ |
||
66 | public function __construct(array $input) |
||
87 | |||
88 | /** |
||
89 | * Construct a DataWrapper from the given JSON string. |
||
90 | * |
||
91 | * @param string $json The json encoded data. |
||
92 | * |
||
93 | * @return static |
||
94 | */ |
||
95 | public static function fromJson(string $json) |
||
99 | |||
100 | /** |
||
101 | * Returns the HTTP status code of the returned result. |
||
102 | * |
||
103 | * @return integer |
||
104 | */ |
||
105 | public function getCode() : int |
||
109 | |||
110 | /** |
||
111 | * Returns A string description of the call status. |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getStatus() : string |
||
119 | |||
120 | /** |
||
121 | * Returns the copyright notice for the returned result. |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | public function getCopyright() : string |
||
129 | |||
130 | /** |
||
131 | * Returns the attribution notice for this result |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | public function getAttributionText() : string |
||
139 | |||
140 | /** |
||
141 | * Returns an HTML representation of the attribution notice for this result. |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getAttributionHTML() : string |
||
149 | |||
150 | /** |
||
151 | * Returns a digest value of the content returned by the call. |
||
152 | * |
||
153 | * @return string |
||
154 | */ |
||
155 | public function getEtag() : string |
||
159 | |||
160 | /** |
||
161 | * Returns the results returned by the call. |
||
162 | * |
||
163 | * @return DataContainerInterface |
||
164 | */ |
||
165 | public function getData() : DataContainerInterface |
||
169 | } |
||
170 |