diff -r d2fba1e3b94b -r 21fab44f46fe Command/ReorderTagsCommand.php --- a/Command/ReorderTagsCommand.php Wed Nov 09 16:25:13 2011 +0100 +++ b/Command/ReorderTagsCommand.php Thu Nov 17 11:29:26 2011 +0100 @@ -54,7 +54,6 @@ $done = 0; $iterable = $query->iterate(); - $todetach = array(); while (($row = $iterable->next()) !== false) { $done++; @@ -66,17 +65,12 @@ $doctrine->getEntityManager()->persist($doc); $search_service->reorderTagsForDocument($doc); - $todetach[] = $doc; if($done%100 == 0) { $doctrine->getEntityManager()->flush(); $doctrine->getEntityManager()->clear(); - /*foreach($todetach as $obj) - { - $doctrine->getEntityManager()->detach($obj); - }*/ $todetach = array(); $output->writeln("memory : ".strval(memory_get_usage(true))); }