mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Changes of objects from custom data type are not stored in database #5883
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gmponos on GitHub (Feb 14, 2018).
I have a custom type like this
The goal of the above custom type is because I have a field in database that stores values in json I want to convert it to a ParameterBag
When on my entity I do something like this:
$myEntity->getField()->set('my_value', 'value')and then I save the entity the values of this field are not stored. All the other values are stored normally.
I use
doctrine/orm: v2.5.14Sorry if the issue exists already. I searched about it but haven't found anything.
@lcobucci commented on GitHub (Feb 20, 2018):
@gmponos could you please send us a failing test case that reproduces that behaviour? It would help us a lot to identify and fix the issue you're describing.
You can find examples on
388afb46d0/tests/Doctrine/Tests/ORM/Functional/Ticket@beberlei commented on GitHub (Dec 7, 2020):
Changeset computation on types does an identity check, i.e. $oldValue === $newValue. This means you have to replace the whole type with a new instance, you cannot just change the state.