1 | <?php |
||
22 | abstract class ResponseDataTransformer implements DataTransformer |
||
23 | { |
||
24 | /** |
||
25 | * The response. |
||
26 | * |
||
27 | * @var Response |
||
28 | */ |
||
29 | private $response; |
||
30 | |||
31 | /** |
||
32 | * The fully qualified class name. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | private $fqcn; |
||
37 | |||
38 | /** |
||
39 | * The model class. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $class; |
||
44 | |||
45 | /** |
||
46 | * Constructor. |
||
47 | * |
||
48 | * @param string $fqcn The fully qualified class name |
||
49 | * |
||
50 | * @throws InvalidModelClassName when the given fqcn is invalid |
||
51 | */ |
||
52 | public function __construct($fqcn) |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function write(Response $response) |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | public function read() |
||
89 | |||
90 | /** |
||
91 | * Builds the object with the response data given. |
||
92 | * |
||
93 | * @param mixed $data The data |
||
94 | * |
||
95 | * @return mixed |
||
96 | */ |
||
97 | private function build($data) |
||
101 | } |
||
102 |