1
0
mirror of synced 2025-02-02 21:41:45 +03:00

Fix return of removeElement on collections

Fixes #5745
This commit is contained in:
Andreas Braun 2017-07-13 08:16:00 +02:00
parent e3ecec36ad
commit 260cc6e3e0
No known key found for this signature in database
GPG Key ID: 110C400BE9468C9A
2 changed files with 2 additions and 6 deletions

View File

@ -373,11 +373,7 @@ final class PersistentCollection extends AbstractLazyCollection implements Selec
$persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);
if ($persister->removeElement($this, $element)) {
return $element;
}
return null;
return $persister->removeElement($this, $element);
}
$removed = parent::removeElement($element);

View File

@ -640,7 +640,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
$group = $this->_em->find(CmsGroup::class, $this->groupId);
$queryCount = $this->getCurrentQueryCount();
$user->groups->removeElement($group);
$this->assertTrue($user->groups->removeElement($group));
$this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a persisted entity should cause one query to be executed.");
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");