1 | <?php |
||
19 | { |
||
20 | private array $references = []; |
||
|
|||
21 | |||
22 | public function normalize($object, $format = null, array $context = []): mixed |
||
23 | { |
||
24 | $object->setReferences($this->references); |
||
25 | $data = parent::normalize($object, $format, $context); |
||
26 | $this->references = array_merge($this->references, $object->getReferences()); |
||
27 | |||
28 | return $data; |
||
29 | } |
||
30 | |||
31 | public function supportsNormalization(mixed $data, $format = null): bool |
||
32 | { |
||
33 | return $data instanceof AbstractNormalizable; |
||
34 | } |
||
35 | } |
||
36 |