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