diff -r d2fba1e3b94b -r 21fab44f46fe Command/SyncDocumentsCommand.php --- a/Command/SyncDocumentsCommand.php Wed Nov 09 16:25:13 2011 +0100 +++ b/Command/SyncDocumentsCommand.php Thu Nov 17 11:29:26 2011 +0100 @@ -10,8 +10,9 @@ namespace IRI\Bundle\WikiTagBundle\Command; +use IRI\Bundle\WikiTagBundle\Event\WikiTagEvents; +use IRI\Bundle\WikiTagBundle\Event\DocumentTagEvent; use Doctrine\ORM\Query; - use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -75,6 +76,11 @@ $todetach[] = $doc; $output->writeln("Process doc id ".$doc->getId()." $done/$total ".strval(intval(floatval($done)/floatval($total)*100.0))."%$memory"); $docrep->updateTagsStr($doc); + //dispatch event + $event_dispatcher = $this->getContainer()->get('event_dispatcher'); + $event = new DocumentTagEvent($doc); + $event_dispatcher->dispatch(WikiTagEvents::onTagChanged, $event); + if($done%10 == 0) { $doctrine->getEntityManager()->flush();