Skip to content
Snippets Groups Projects
Commit 1429dd7f authored by Ere Maijala's avatar Ere Maijala
Browse files

Use correct record driver for deduplicated records.

parent b12f4501
Branches
Tags
No related merge requests found
...@@ -269,7 +269,8 @@ class DeduplicationListener ...@@ -269,7 +269,8 @@ class DeduplicationListener
$recordSources, $recordSources,
$sourcePriority $sourcePriority
); );
$record->setRawData($localRecordData); $foundLocalRecord->setRawData($localRecordData);
$result->replace($record, $foundLocalRecord);
} }
} }
......
...@@ -138,6 +138,22 @@ abstract class AbstractRecordCollection implements RecordCollectionInterface ...@@ -138,6 +138,22 @@ abstract class AbstractRecordCollection implements RecordCollectionInterface
} }
} }
/**
* Replace a record in the collection.
*
* @param RecordInterface $record Record to be replaced
* @param RecordInterface $replacement Replacement record
*
* @return void
*/
public function replace(RecordInterface $record, RecordInterface $replacement)
{
$key = array_search($record, $this->records, true);
if ($key !== false) {
$this->records[$key] = $replacement;
}
}
/// Iterator interface /// Iterator interface
/** /**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment