Command/SyncDocumentsCommand.php
changeset 24 cd389bf882f1
parent 23 b435f8055cb4
child 27 8551d844b4f3
--- a/Command/SyncDocumentsCommand.php	Fri Nov 04 11:56:59 2011 +0100
+++ b/Command/SyncDocumentsCommand.php	Fri Nov 04 15:53:59 2011 +0100
@@ -50,7 +50,11 @@
         //TODO : check class to implement DocumentInterface
         //TODO : write progress
         $doclist = $rep->findAll();
+        $total = count($doclist);
+        $done = 0;
         foreach ($doclist as $doc) {
+            $done++;
+            $output->writeln("Process doc id ".$doc->getId()." $done/$total ".strval(intval(floatval($done)/floatval($total)*100.0))."%");
             $docrep->writeDocument($doc, $this->getContainer()->getParameter('wiki_tag.document_id_column'), $this->getContainer()->getParameter('wiki_tag.fields'));
         }
         $doctrine->getEntityManager()->flush();