-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.0] Change Sets #14
base: master
Are you sure you want to change the base?
Conversation
* @param PersistentCollectionInterface $collection | ||
* @param ObjectChangeSet[] $changes | ||
*/ | ||
public function __construct(PersistentCollectionInterface $collection, array $changes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing we'll have to think of is the ability to replace collections:
$object->embedMany = []
This won't just be a collection changeset but instead the entire collection gets replaced with a new collection. In order to properly populate insertedDocuments and deletedDocuments we'd have to know about both collections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm somehow I'd see FieldChange
for such action, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So FieldChange(oldCollection, newArray)
? That could work - I was just wondering how we could accomodate this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done like this, it's also working like this for exchanged embedded documents :)
8f69bdc
to
1e3f9bb
Compare
f1b9da8
to
1f11137
Compare
[2.0] Bump PHP to 7.0
[2.0] Remove deprecated annotations
BC Breaks in
BCish introduction of ObjectChangeSet
UnitOfWork::getDocumentChangeSet
is now returningObjectChangeSet|null
. This will makeempty($changeSet)
checks still valid however allis_array
or comparing anything to an array will break.BC Breaks in
Use ObjectChangeSet for modified embedded documents
ObjectChangeSet
which does not (yet?) provides BC for accessing[0]
and[1]
for old and new value respectively.