Permalink
Browse files

Skip object serialization during removal

  • Loading branch information...
1 parent 6d1195f commit cf593716a1a8ad76dd52a9e743b1d7c5020c9936 @MrHash MrHash committed Apr 28, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Doctrine/Search/SearchManager.php
@@ -204,7 +204,7 @@ protected function commitPersisted()
protected function commitRemoved()
{
- $documents = $this->sortObjects($this->removed);
+ $documents = $this->sortObjects($this->removed, false);
foreach($documents as $index => $documentTypes)
{
@@ -215,13 +215,13 @@ protected function commitRemoved()
}
}
- protected function sortObjects(array $objects)
+ protected function sortObjects(array $objects, $serialize = true)
{
$documents = array();
foreach($objects as $object)
{
$metadata = $this->getClassMetadata(get_class($object));
- $document = $this->serializer->serialize($object);
+ $document = $serialize ? $this->serializer->serialize($object) : $object;
$documents[$metadata->index][$metadata->type][$object->getId()] = $document;
}
return $documents;

0 comments on commit cf59371

Please sign in to comment.