orm icon indicating copy to clipboard operation
orm copied to clipboard

Documentation clarification - how to track changes to Custom Types that map to PHP objects

Open courtney-miles opened this issue 8 years ago • 1 comments

I have a custom type that maps an ArrayCollection of PHP object to JSON, and I need the changes persisted the database any time the ArrayCollection changes, or the properties of the objects within the array collection changes.

I have found a few people report that objects are not tracked by UnitOfWork -- which is why my UPDATEs are not working. If this were true, and that Custom Types can only be tracked if they map to PHP scalars or arrays, I would expect the Custom Mapping Types documentation to include disclaimer about this.

If PHP Objects can be tracked by UnitOfWork, can the documentation be updated with some details of strategy for how?

I was hoping UnitOfWork would be able to use convertToDatabaseValue() for a before an after check to determine changes on a custom type.

courtney-miles avatar Nov 19 '16 22:11 courtney-miles

https://github.com/doctrine/orm/issues/5542

Aliance avatar Mar 15 '24 10:03 Aliance