Fixed the way the listener compares two objects

This commit is contained in:
William DURAND 2011-05-05 19:17:40 +02:00
parent aa7eb61088
commit 0bd6875f20

View file

@ -25,7 +25,7 @@ class MergeCollectionListener implements EventSubscriberInterface
} else {
// merge $data into $collection
foreach ($collection as $model) {
if (!$data->contains($model)) {
if ($data->search($model) === false) {
$collection->remove($model);
} else {
$data->remove($model);