From 15731c7bde96bfc77e9d761ce1ee80269cbb5ad6 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 4a64c8fd6..0b57302c0 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -719,6 +719,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; } }