1 | <?php |
||
17 | class ComradeDeserializer |
||
18 | { |
||
19 | /** @var string $response */ |
||
20 | private $response; |
||
21 | |||
22 | /** @var Serializer $serializer */ |
||
23 | protected $serializer; |
||
24 | |||
25 | /** |
||
26 | * @param string $response |
||
27 | * @param Serializer $serializer |
||
28 | */ |
||
29 | public function __construct($response, Serializer $serializer) |
||
34 | |||
35 | /** |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getPlainResponse() |
||
42 | |||
43 | /** |
||
44 | * @throws DeserializerException |
||
45 | * @return array |
||
46 | */ |
||
47 | public function getResponse() |
||
60 | |||
61 | /** |
||
62 | * @return array |
||
63 | */ |
||
64 | public function getData() |
||
78 | |||
79 | /** |
||
80 | * @param string $targetEntity |
||
81 | * @return object |
||
82 | */ |
||
83 | public function decode($targetEntity) |
||
90 | |||
91 | /** |
||
92 | * Decodes a response into array of objects or into a PaginatedResults |
||
93 | * |
||
94 | * @param string $targetEntity |
||
95 | * @return object[]|PaginatedResults |
||
96 | */ |
||
97 | public function decodeMultiple($targetEntity) |
||
124 | |||
125 | /** |
||
126 | * @param array $array |
||
127 | * @return array |
||
128 | */ |
||
129 | private function _convertNaming($array) |
||
140 | } |