Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

Skip \Traversable Check in Symfony Serializer

$
0
0

I have a Class that implements \Iterator, so I can use it in a foreach loop.

But during serialization, I want Symfony to serialize it as it is (without some Properties, that I ignore with AbstractNormalizer::IGNORED_ATTRIBUTES).

Before adding \Iterator, everything worked as expected.

But now, it fails to do that because of a supportsNormalization() in AbstractObjectNormalizer check.

How can I get back the previous behaviour without having to remove the Interface?

Thank you!


Viewing all articles
Browse latest Browse all 3924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>