Doctrine\ORM\Tools\SchemaTool::dropDatabase PHP Method

dropDatabase() public method

Drops all elements in the database of the current connection.
public dropDatabase ( ) : void
return void
    public function dropDatabase()
    {
        $dropSchemaSql = $this->getDropDatabaseSQL();
        $conn = $this->_em->getConnection();

        foreach ($dropSchemaSql as $sql) {
            $conn->executeQuery($sql);
        }
    }

Usage Example

Example #1
0
 protected function tearDown()
 {
     // Clean anything still idle in the UOW
     $this->_em->clear();
     // Clear out anything set in the db (schema is recreated on setUp()
     $this->_schemaTool->dropDatabase();
 }
All Usage Examples Of Doctrine\ORM\Tools\SchemaTool::dropDatabase