Affects Version/s: None
Fix Version/s: None
Security Level: All
Currently our UnitOfWork computes the changeset by checking actual instances of Objects.
While this is ok when you do new object assignments, it just bypass same instances of same object, since the hash is the same.
A user on IRC (post-o-matic) has a quite complex object logic that he would like to avoid clone and even instantiate another class.
I agree with him that cloning is not the ideal technique, mainly because the changeset would always compute the object (since then hashs would be different).
He implemented this datatype:
I was thinking in a possible alternative and it came up to me the same basic idea we have with operators overloading OR Comparable interface of Java. I know in Java it supports way more things, but at least for this situation (as a start point) it would make developer's life easier.
Basic idea is to have an interface in Doctrine\Common:
And update our UnitOfWork to take advantage of it:
In this user's usecase, it'd require him to update the EffortGraph class and implement Comparable interface.
For his specific situation, he'd need to store original value and updated value, just like we do internally in UnitOfWork for Entities.
|Field||Original Value||New Value|
|Assignee||Guilherme Blanco [ guilhermeblanco ]||Roman S. Borschel [ romanb ]|
|Workflow||jira [ 10791 ]||jira-feedback [ 13840 ]|
|Workflow||jira-feedback [ 13840 ]||jira-feedback2 [ 15704 ]|
|Workflow||jira-feedback2 [ 15704 ]||jira-feedback3 [ 17961 ]|