public function writeMigrationClass(Bundle $bundle, $driverName, $version, array $queries)
    {
        if (!$this->hasSqlExtension) {
            $this->twigEnvironment->addExtension(new SqlFormatterExtension());
            $this->hasSqlExtension = true;
        }

        $targetDir = "{$bundle->getPath()}/Migrations/{$driverName}";
        $class = "Version{$version}";
        $namespace = "{$bundle->getNamespace()}\\Migrations\\{$driverName}";
        $classFile = "{$targetDir}/{$class}.php";

        if (!$this->fileSystem->exists($targetDir)) {
            $this->fileSystem->mkdir($targetDir);
        }

        $content = $this->twigEngine->render(
            'ClarolineMigrationBundle::migration_class.html.twig',
            array(
                'namespace' => $namespace,
                'class' => $class,
                'upQueries' => $queries[Generator::QUERIES_UP],
                'downQueries' => $queries[Generator::QUERIES_DOWN],
            )
        );

        $this->fileSystem->touch($classFile);
        file_put_contents($classFile, $content);
    }
public function writeMigrationClass(Bundle $bundle, $driverName, $version, array $queries)
    {
        if (!$this->hasSqlExtension) {
            $this->twigEnvironment->addExtension(new SqlFormatterExtension());
            $this->hasSqlExtension = true;
        }

        $targetDir = "{$bundle->getPath()}/Migrations/{$driverName}";
        $class = "Version{$version}";
        $namespace = "{$bundle->getNamespace()}\\Migrations\\{$driverName}";
        $classFile = "{$targetDir}/{$class}.php";

        if (!$this->fileSystem->exists($targetDir)) {
            $this->fileSystem->mkdir($targetDir);
        }

        $content = $this->twigEngine->render(
            'ClarolineMigrationBundle::migration_class.html.twig',
            array(
                'namespace' => $namespace,
                'class' => $class,
                'upQueries' => $queries[Generator::QUERIES_UP],
                'downQueries' => $queries[Generator::QUERIES_DOWN],
            )
        );

        $this->fileSystem->touch($classFile);
        file_put_contents($classFile, $content);
    }
public function writeMigrationClass ( Bundle $ bundle , $ driverName , $ version , array $ queries ) { if ( ! $ this -> hasSqlExtension ) { $ this -> twigEnvironment -> addExtension ( new SqlFormatterExtension ( ) ) ; $ this -> hasSqlExtension = true ; } $ targetDir = "{$bundle->getPath()}/Migrations/{$driverName}" ; $ class = "Version{$version}" ; $ namespace = "{$bundle->getNamespace()}\\Migrations\\{$driverName}" ; $ classFile = "{$targetDir}/{$class}.php" ; if ( ! $ this -> fileSystem -> exists ( $ targetDir ) ) { $ this -> fileSystem -> mkdir ( $ targetDir ) ; } $ content = $ this -> twigEngine -> render ( 'ClarolineMigrationBundle::migration_class.html.twig' , array ( 'namespace' => $ namespace , 'class' => $ class , 'upQueries' => $ queries [ Generator :: QUERIES_UP ] , 'downQueries' => $ queries [ Generator :: QUERIES_DOWN ] , ) ) ; $ this -> fileSystem -> touch ( $ classFile ) ; file_put_contents ( $ classFile , $ content ) ; }
Writes a bundle migration class for a given driver.

@param \Symfony\Component\HttpKernel\Bundle\Bundle $bundle
@param string                                      $driverName
@param string                                      $version
@param array                                       $queries
Writes a bundle migration class for a given driver .