| @@ 25-33 (lines=9) @@ | ||
| 22 | } |
|
| 23 | ||
| 24 | /** {@inheritdoc} */ |
|
| 25 | public function normalize($object, $format = null, array $context = []) |
|
| 26 | { |
|
| 27 | $jmsContext = SerializationContext::create(); |
|
| 28 | if (array_key_exists('groups', $context)) { |
|
| 29 | $jmsContext->setGroups($context['groups']); |
|
| 30 | } |
|
| 31 | ||
| 32 | return $this->serializer->toArray($object, $jmsContext); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** {@inheritdoc} */ |
|
| 36 | public function supportsNormalization($data, $format = null) |
|
| @@ 26-34 (lines=9) @@ | ||
| 23 | } |
|
| 24 | ||
| 25 | /** {@inheritdoc} */ |
|
| 26 | public function serialize($data, $format, array $context = []) |
|
| 27 | { |
|
| 28 | $jmsContext = SerializationContext::create(); |
|
| 29 | if (array_key_exists('groups', $context)) { |
|
| 30 | $jmsContext->setGroups($context['groups']); |
|
| 31 | } |
|
| 32 | ||
| 33 | return $this->serializer->serialize($data, $format, $jmsContext); |
|
| 34 | } |
|
| 35 | ||
| 36 | /** {@inheritdoc} */ |
|
| 37 | public function deserialize($data, $type, $format, array $context = []) |
|
| @@ 37-45 (lines=9) @@ | ||
| 34 | } |
|
| 35 | ||
| 36 | /** {@inheritdoc} */ |
|
| 37 | public function deserialize($data, $type, $format, array $context = []) |
|
| 38 | { |
|
| 39 | $jmsContext = DeserializationContext::create(); |
|
| 40 | if (array_key_exists('groups', $context)) { |
|
| 41 | $jmsContext->setGroups($context['groups']); |
|
| 42 | } |
|
| 43 | ||
| 44 | $this->serializer->deserialize($data, $type, $format, $jmsContext); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||