From a2ca6bbfafd0200d2cf658f5b4fd9e80d65c3d9d Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Fri, 11 Aug 2017 21:09:34 +0200 Subject: [PATCH] #6613 #6614 #6616 ensuring that the collection is marked as non-dirty if all new items are contained in the initialized ones --- lib/Doctrine/ORM/PersistentCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 3dc254a53..1ce3e495b 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -727,6 +727,6 @@ final class PersistentCollection extends AbstractLazyCollection implements Selec // Reattach NEW objects added through add(), if any. array_walk($newObjectsThatWereNotLoaded, [$this->collection, 'add']); - $this->isDirty = true; + $this->isDirty = (bool) $newObjectsThatWereNotLoaded; } }