MigrationBundle/Migrations/Version20170307181737.php
protected function updateFolderNames(Database $db)
    {
        $this->write('  + Updating folderNames');

        $this->checkExecute($db->execute('
            var backLanguages = ' . json_encode($this->container->getParameter('open_orchestra_base.administration_languages')) . ';

            db.folder.find({}).snapshot().forEach(function(folder) {
                var name = folder.name;

                folder.names = {};
                for (var language in backLanguages) {
                    folder.names[backLanguages[language]] = name;
                }

                delete folder.name;
                db.folder.update({_id: folder._id}, folder);
            });
        '));
    }
protected function updateFolderNames(Database $db)
    {
        $this->write('  + Updating folderNames');

        $this->checkExecute($db->execute('
            var backLanguages = ' . json_encode($this->container->getParameter('open_orchestra_base.administration_languages')) . ';

            db.folder.find({}).snapshot().forEach(function(folder) {
                var name = folder.name;

                folder.names = {};
                for (var language in backLanguages) {
                    folder.names[backLanguages[language]] = name;
                }

                delete folder.name;
                db.folder.update({_id: folder._id}, folder);
            });
        '));
    }
protected function updateFolderNames ( Database $ db ) { $ this -> write ( '  + Updating folderNames' ) ; $ this -> checkExecute ( $ db -> execute ( '
            var backLanguages = ' . json_encode ( $ this -> container -> getParameter ( 'open_orchestra_base.administration_languages' ) ) . ';

            db.folder.find({}).snapshot().forEach(function(folder) {
                var name = folder.name;

                folder.names = {};
                for (var language in backLanguages) {
                    folder.names[backLanguages[language]] = name;
                }

                delete folder.name;
                db.folder.update({_id: folder._id}, folder);
            });
        ' ) ) ; }
Internationalize Folder name

@param Database $db
Internationalize Folder name