1
0
mirror of synced 2025-02-20 22:23:14 +03:00

Remove useless exception

This commit is contained in:
Michaël Gallego 2013-12-23 21:13:52 +01:00
parent bb1f71f1f9
commit c69b7562ab

View File

@ -869,11 +869,6 @@ final class PersistentCollection implements Collection, Selectable
return $this->coll->matching($criteria);
}
if ($this->association['type'] !== ClassMetadata::ONE_TO_MANY
&& $this->association['type'] !== ClassMetadata::MANY_TO_MANY) {
throw new \RuntimeException("Matching Criteria on PersistentCollection only works on OneToMany and ManyToMany associations at the moment.");
}
if ($this->association['type'] === ClassMetadata::MANY_TO_MANY) {
$persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);
return new ArrayCollection($persister->loadCriteria($this, $criteria));