Commit 3eb386c8 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Fix clearQueries(), thanks @Stof

parent 5dc31c0b
......@@ -36,7 +36,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform,
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
class DropSchemaSqlCollector implements Visitor
......@@ -68,9 +67,7 @@ class DropSchemaSqlCollector implements Visitor
public function __construct(AbstractPlatform $platform)
{
$this->platform = $platform;
$this->constraints = new \SplObjectStorage();
$this->sequences = new \SplObjectStorage();
$this->tables = new \SplObjectStorage();
$this->clearQueries();
}
/**
......@@ -129,11 +126,13 @@ class DropSchemaSqlCollector implements Visitor
}
/**
* @return array
* @return void
*/
public function clearQueries()
{
$this->constraints = $this->sequences = $this->tables = array();
$this->constraints = new \SplObjectStorage();
$this->sequences = new \SplObjectStorage();
$this->tables = new \SplObjectStorage();
}
/**
......@@ -150,7 +149,7 @@ class DropSchemaSqlCollector implements Visitor
foreach ($this->sequences AS $sequence) {
$sql[] = $this->platform->getDropSequenceSQL($sequence->getQuotedName($this->platform));
}
foreach ($this->tables AS $table) {
$sql[] = $this->platform->getDropTableSQL($table->getQuotedName($this->platform));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment