Answer the question
In order to leave comments, you need to log in
How to globally get rid of PersistentCollection?
Good afternoon.
I have one complex document in my project, made up of several EmbeddedDocuments of rather large nesting - a player profile in an RPG game. In total, about 50 classes are involved in the document. In places, inclusion via @EmbedMany is used, which gives PersistentCollections when hydrating documents. Almost all classes were automatically generated by thrift-compiler, so adding methods to them that will clear the PersistentCollection seems to me a bit unnatural. Then, according to these generated classes, doctrine odm mappings were generated in the form of yaml files.
Task: Download player profile from mongodb using doctrine odm and write to thrift.
Problem: thrift's pure-php implementation handles PersistentCollections just fine. But when trying to write to thrift using TBinaryProtocolAccelerated (and the binary extension thrift_protocol.so enabled), the write fails with an Exception:
Thrift\Exception\TProtocolException: Attempt to send non-object type as a T_STRUCT
Answer the question
In order to leave comments, you need to log in
In the end, I went down the third path. Everything works as it should.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question