I have an object that has an instance of Doctrine\ODM\MongoDB\Query\Builder . When I serialize my object, unserialize it, and then try to use the Builder, I get the following error:
Fatal error: Uncaught exception 'MongoException' with message 'The MongoCursor object has not been correctly initialized by its constructor'
I assume that this is because PHP looses its connection to the mongo server in the serialization process. How can I fix this?