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, ...@@ -36,7 +36,6 @@ use Doctrine\DBAL\Platforms\AbstractPlatform,
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org * @link www.doctrine-project.org
* @since 2.0 * @since 2.0
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de> * @author Benjamin Eberlei <kontakt@beberlei.de>
*/ */
class DropSchemaSqlCollector implements Visitor class DropSchemaSqlCollector implements Visitor
...@@ -68,9 +67,7 @@ class DropSchemaSqlCollector implements Visitor ...@@ -68,9 +67,7 @@ class DropSchemaSqlCollector implements Visitor
public function __construct(AbstractPlatform $platform) public function __construct(AbstractPlatform $platform)
{ {
$this->platform = $platform; $this->platform = $platform;
$this->constraints = new \SplObjectStorage(); $this->clearQueries();
$this->sequences = new \SplObjectStorage();
$this->tables = new \SplObjectStorage();
} }
/** /**
...@@ -129,11 +126,13 @@ class DropSchemaSqlCollector implements Visitor ...@@ -129,11 +126,13 @@ class DropSchemaSqlCollector implements Visitor
} }
/** /**
* @return array * @return void
*/ */
public function clearQueries() 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 ...@@ -150,7 +149,7 @@ class DropSchemaSqlCollector implements Visitor
foreach ($this->sequences AS $sequence) { foreach ($this->sequences AS $sequence) {
$sql[] = $this->platform->getDropSequenceSQL($sequence->getQuotedName($this->platform)); $sql[] = $this->platform->getDropSequenceSQL($sequence->getQuotedName($this->platform));
} }
foreach ($this->tables AS $table) { foreach ($this->tables AS $table) {
$sql[] = $this->platform->getDropTableSQL($table->getQuotedName($this->platform)); $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