public function createSchema($outputPathAndFilename = null)
    {
        $schemaTool = new SchemaTool($this->entityManager);
        $allMetaData = $this->entityManager->getMetadataFactory()->getAllMetadata();
        if ($outputPathAndFilename === null) {
            $schemaTool->createSchema($allMetaData);
        } else {
            $createSchemaSqlStatements = $schemaTool->getCreateSchemaSql($allMetaData);
            file_put_contents($outputPathAndFilename, implode(PHP_EOL, $createSchemaSqlStatements));
        }
    }
public function createSchema($outputPathAndFilename = null)
    {
        $schemaTool = new SchemaTool($this->entityManager);
        $allMetaData = $this->entityManager->getMetadataFactory()->getAllMetadata();
        if ($outputPathAndFilename === null) {
            $schemaTool->createSchema($allMetaData);
        } else {
            $createSchemaSqlStatements = $schemaTool->getCreateSchemaSql($allMetaData);
            file_put_contents($outputPathAndFilename, implode(PHP_EOL, $createSchemaSqlStatements));
        }
    }
public function createSchema ( $ outputPathAndFilename = null ) { $ schemaTool = new SchemaTool ( $ this -> entityManager ) ; $ allMetaData = $ this -> entityManager -> getMetadataFactory ( ) -> getAllMetadata ( ) ; if ( $ outputPathAndFilename === null ) { $ schemaTool -> createSchema ( $ allMetaData ) ; } else { $ createSchemaSqlStatements = $ schemaTool -> getCreateSchemaSql ( $ allMetaData ) ; file_put_contents ( $ outputPathAndFilename , implode ( PHP_EOL , $ createSchemaSqlStatements ) ) ; } }
Creates the needed DB schema using Doctrine's SchemaTool. If tables already
exist, this will throw an exception.

@param string $outputPathAndFilename A file to write SQL to, instead of executing it
@return string
@throws ToolsException
Creates the needed DB schema using Doctrine s SchemaTool . If tables already exist this will throw an exception .