eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\RegenerateUrlAliasesCommand::doBackupGlobalAliases PHP Method

doBackupGlobalAliases() protected method

Internal method for backing up global URL aliases.
See also: eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\RegenerateUrlAliasesCommand::backupGlobalAliases()
protected doBackupGlobalAliases ( )
    protected function doBackupGlobalAliases()
    {
        $aliases = $this->urlAliasHandler->listGlobalURLAliases();
        $totalCount = count($aliases);
        $pathCount = 0;
        if ($totalCount === 0) {
            $this->output->writeln('Could not find any global URL aliases, nothing to backup.');
            $this->output->writeln('');
            return;
        }
        $this->output->writeln("Backing up {$totalCount} global URL aliases.");
        $progressBar = $this->getProgressBar($totalCount);
        $progressBar->start();
        foreach ($aliases as $alias) {
            $pathCount += $this->storeGlobalAlias($alias);
            $progressBar->advance();
        }
        $progressBar->finish();
        $this->output->writeln('');
        $this->output->writeln("Done. Backed up {$totalCount} global URL alias(es) " . "with {$pathCount} path(s).");
        $this->output->writeln('');
    }