1
0
mirror of synced 2025-01-06 00:57:10 +03:00

Removed Facade.

This commit is contained in:
Jonathan.Wage 2007-10-19 14:30:48 +00:00
parent 779003edcc
commit 16933ef9be
6 changed files with 13 additions and 24 deletions

View File

@ -127,20 +127,9 @@ class Doctrine_Export extends Doctrine_Connection_Module
public function dropConstraint($table, $name, $primary = false) public function dropConstraint($table, $name, $primary = false)
{ {
$table = $this->conn->quoteIdentifier($table); $table = $this->conn->quoteIdentifier($table);
$name = $this->conn->quoteIdentifier($name); $name = $this->conn->quoteIdentifier($this->conn->formatter->getIndexName($name));
return $this->conn->exec('ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $name); return $this->conn->exec('ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $name);
} }
/**
* drop existing foreign key
*
* @param string $table name of table that should be used in method
* @param string $name name of the foreign key to be dropped
* @return void
*/
public function dropForeignKey($table, $name)
{
return $this->dropConstraint($table, $name);
}
/** /**
* dropSequenceSql * dropSequenceSql
* drop existing sequence * drop existing sequence
@ -1000,9 +989,9 @@ class Doctrine_Export extends Doctrine_Connection_Module
public function exportSchema($directory = null) public function exportSchema($directory = null)
{ {
if ($directory !== null) { if ($directory !== null) {
$models = Doctrine_Facade::loadModels($directory); $models = Doctrine::loadModels($directory);
} else { } else {
$models = Doctrine_Facade::getLoadedModels(); $models = Doctrine::getLoadedModels();
} }
$this->exportClasses($models); $this->exportClasses($models);
@ -1080,7 +1069,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
*/ */
public function exportClassesSql(array $classes) public function exportClassesSql(array $classes)
{ {
$models = Doctrine_Facade::getLoadedModels($classes); $models = Doctrine::getLoadedModels($classes);
$sql = array(); $sql = array();
@ -1159,9 +1148,9 @@ class Doctrine_Export extends Doctrine_Connection_Module
public function exportSql($directory = null) public function exportSql($directory = null)
{ {
if ($directory !== null) { if ($directory !== null) {
$models = Doctrine_Facade::loadModels($directory); $models = Doctrine::loadModels($directory);
} else { } else {
$models = Doctrine_Facade::getLoadedModels(); $models = Doctrine::getLoadedModels();
} }
return $this->exportClassesSql($models); return $this->exportClassesSql($models);

View File

@ -38,6 +38,6 @@ class Doctrine_Task_GenerateYamlFromDb extends Doctrine_Task
public function execute() public function execute()
{ {
Doctrine_Facade::generateYamlFromDb($this->getArgument('yaml_schema_path')); Doctrine::generateYamlFromDb($this->getArgument('yaml_schema_path'));
} }
} }

View File

@ -39,6 +39,6 @@ class Doctrine_Task_GenerateYamlFromModels extends Doctrine_Task
public function execute() public function execute()
{ {
Doctrine_Facade::generateYamlFromModels($this->getArgument('yaml_schema_path'), $this->getArgument('models_path')); Doctrine::generateYamlFromModels($this->getArgument('yaml_schema_path'), $this->getArgument('models_path'));
} }
} }

View File

@ -39,7 +39,7 @@ class Doctrine_Task_LoadData extends Doctrine_Task
public function execute() public function execute()
{ {
Doctrine_Facade::loadModels($this->getArgument('models_path')); Doctrine::loadModels($this->getArgument('models_path'));
Doctrine_Facade::loadData($this->getArgument('data_fixtures_path')); Doctrine::loadData($this->getArgument('data_fixtures_path'));
} }
} }

View File

@ -39,7 +39,7 @@ class Doctrine_Task_LoadDummyData extends Doctrine_Task
public function execute() public function execute()
{ {
Doctrine_Facade::loadModels($this->getArgument('models_path')); Doctrine::loadModels($this->getArgument('models_path'));
Doctrine_Facade::loadDummyData($this->getArgument('append') ? true:false, $this->getArgument('num') ? $this->getArgument('num'):5); Doctrine::loadDummyData($this->getArgument('append') ? true:false, $this->getArgument('num') ? $this->getArgument('num'):5);
} }
} }

View File

@ -38,6 +38,6 @@ class Doctrine_Task_Migrate extends Doctrine_Task
public function execute() public function execute()
{ {
Doctrine_Facade::migrate($this->getArgument('version')); Doctrine::migrate($this->getArgument('version'));
} }
} }