Doctrine\ORM\Tools\SchemaTool::dropSchema PHP Méthode

dropSchema() public méthode

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
Résultat void
    public function dropSchema(array $classes)
    {
        $dropSchemaSql = $this->getDropSchemaSql($classes);
        $conn = $this->_em->getConnection();

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

Usage Example

Exemple #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