dunglas/doctrine-json-odm

de-serialized entities have id: NULL unless setId($id) method created

epoplive opened this issue · 2 comments

I'm trying to use this, but I'm finding that all of my serialized doctrine entities have an id of NULL unless I create a setId($id) method in each entity.

Is this issue still relevant or has it been resolved in the meantime?

It is still relevant, but the clue is it only happens if the class has a getId method, which leads me to believe it goes into a getter / setter mode. So, for anyone experiencing this, either use both getId(), setId(), or neither, don't declare just one of them.