|
@@ -8,6 +8,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
8
|
8
|
use Symfony\Component\Console\Input\InputOption;
|
9
|
9
|
use Symfony\Component\Console\Output\OutputInterface;
|
10
|
10
|
//use Muzich\CoreBundle\Managers\CommentsManager;
|
|
11
|
+use Muzich\CoreBundle\Util\StrictCanonicalizer;
|
11
|
12
|
|
12
|
13
|
class MigrationUpgradeCommand extends ContainerAwareCommand
|
13
|
14
|
{
|
|
@@ -63,6 +64,23 @@ class MigrationUpgradeCommand extends ContainerAwareCommand
|
63
|
64
|
$output->writeln('<info>Terminé !</info>');
|
64
|
65
|
}
|
65
|
66
|
|
|
67
|
+ if ($input->getArgument('from') == '0.9.8.1' && $input->getArgument('to') == '0.9.8.2')
|
|
68
|
+ {
|
|
69
|
+ $proceeded = true;
|
|
70
|
+ $canonicalizer = new StrictCanonicalizer();
|
|
71
|
+ $elements = $em->getRepository('MuzichCoreBundle:Element')->findAll();
|
|
72
|
+ foreach ($elements as $element)
|
|
73
|
+ {
|
|
74
|
+ $element->setSlug($canonicalizer->canonicalize_stricter($element->getName()));
|
|
75
|
+ $output->write('.');
|
|
76
|
+ $em->persist($element);
|
|
77
|
+ }
|
|
78
|
+
|
|
79
|
+ $output->writeln('<info>Save in Database ...</info>');
|
|
80
|
+ $em->flush();
|
|
81
|
+ $output->writeln('<info>Terminé !</info>');
|
|
82
|
+ }
|
|
83
|
+
|
66
|
84
|
if (!$proceeded)
|
67
|
85
|
{
|
68
|
86
|
$output->writeln('<error>Versions saisies non prises en charges</error>');
|