Conversation
| * @param PersistentCollectionInterface $collection | ||
| * @param ObjectChangeSet[] $changes | ||
| */ | ||
| public function __construct(PersistentCollectionInterface $collection, array $changes) |
There was a problem hiding this comment.
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.
Owner
Author
There was a problem hiding this comment.
Hmmm somehow I'd see FieldChange for such action, what do you think?
There was a problem hiding this comment.
So FieldChange(oldCollection, newArray)? That could work - I was just wondering how we could accomodate this.
Owner
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BC Breaks in
BCish introduction of ObjectChangeSetUnitOfWork::getDocumentChangeSetis now returningObjectChangeSet|null. This will makeempty($changeSet)checks still valid however allis_arrayor comparing anything to an array will break.BC Breaks in
Use ObjectChangeSet for modified embedded documentsObjectChangeSetwhich does not (yet?) provides BC for accessing[0]and[1]for old and new value respectively.