| 1 | <?php |
||
| 13 | class Hateoas implements SerializerInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var SerializerInterface |
||
| 17 | */ |
||
| 18 | private $serializer; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var LinkHelper |
||
| 22 | */ |
||
| 23 | private $linkHelper; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param SerializerInterface $serializer |
||
| 27 | * @param LinkHelper $linkHelper |
||
| 28 | */ |
||
| 29 | public function __construct(SerializerInterface $serializer, LinkHelper $linkHelper) |
||
| 30 | { |
||
| 31 | $this->serializer = $serializer; |
||
| 32 | $this->linkHelper = $linkHelper; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * {@inheritdoc} |
||
| 37 | */ |
||
| 38 | public function serialize($data, $format, SerializationContext $context = null) |
||
| 39 | { |
||
| 40 | return $this->serializer->serialize($data, $format, $context); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * {@inheritdoc} |
||
| 45 | */ |
||
| 46 | public function deserialize($data, $type, $format, DeserializationContext $context = null) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return SerializerInterface |
||
| 53 | */ |
||
| 54 | public function getSerializer() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return LinkHelper |
||
| 61 | */ |
||
| 62 | public function getLinkHelper() |
||
| 66 | } |
||
| 67 |