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