1 | <?php |
||
13 | class Serializer implements SerializerInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var SymfonySerializer |
||
17 | */ |
||
18 | private $serializer; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private $map = array( |
||
24 | 'video' => 'Bangpound\\oEmbed\\Response\\VideoResponse', |
||
25 | 'photo' => 'Bangpound\\oEmbed\\Response\\PhotoResponse', |
||
26 | 'link' => 'Bangpound\\oEmbed\\Response\\LinkResponse', |
||
27 | 'rich' => 'Bangpound\\oEmbed\\Response\\RichResponse', |
||
28 | ); |
||
29 | |||
30 | 28 | public function __construct(SymfonySerializer $serializer, array $map = null) |
|
37 | |||
38 | 24 | public function deserialize($data, $type, $format, array $context = array()) |
|
47 | |||
48 | 16 | public function serialize($data, $format, array $context = array()) |
|
52 | |||
53 | 28 | public static function create(array $map = null) |
|
66 | } |
||
67 |