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

dropSchema() public method

In any way when an exception is thrown it is supressed since drop was issued for all classes of the schema and some probably just don't exist.
public dropSchema ( array $classes ) : void
$classes array
return void
    public function dropSchema(array $classes)
    {
        $dropSchemaSql = $this->getDropSchemaSql($classes);
        $conn = $this->_em->getConnection();

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

Usage Example

Example #1
0
 public function createSchema($table)
 {
     foreach (self::$classes as $meta) {
         if ($table === $meta->getTableName() || ".{$table}" === substr($meta->getTableName(), -strlen(".{$table}"))) {
             self::$tool->dropSchema([$meta]);
             self::$tool->createSchema([$meta]);
         }
     }
 }
All Usage Examples Of Doctrine\ORM\Tools\SchemaTool::dropSchema