Changes extenstion to .php instead of .class.php to be consistant with all of Doctrine.
This commit is contained in:
parent
6f07c2b100
commit
d099c2e357
@ -196,7 +196,7 @@ class Doctrine_Import extends Doctrine_Connection_Module
|
||||
* @param array $databases
|
||||
* @return array the names of the imported classes
|
||||
*/
|
||||
public function importSchema($directory, array $databases = array())
|
||||
public function importSchema($directory, array $databases = array(), array $options = array())
|
||||
{
|
||||
$connections = Doctrine_Manager::getInstance()->getConnections();
|
||||
|
||||
@ -208,8 +208,8 @@ class Doctrine_Import extends Doctrine_Connection_Module
|
||||
}
|
||||
|
||||
$builder = new Doctrine_Import_Builder();
|
||||
$builder->generateBaseClasses(true);
|
||||
$builder->setTargetPath($directory);
|
||||
$builder->setOptions($options);
|
||||
|
||||
$classes = array();
|
||||
foreach ($connection->import->listTables() as $table) {
|
||||
|
@ -68,7 +68,7 @@ class Doctrine_Import_Builder
|
||||
*
|
||||
* @var string $suffix
|
||||
*/
|
||||
protected $_suffix = '.class.php';
|
||||
protected $_suffix = '.php';
|
||||
|
||||
/**
|
||||
* generateBaseClasses
|
||||
@ -235,6 +235,34 @@ class Doctrine_Import_Builder
|
||||
return $this->_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* setOptions
|
||||
*
|
||||
* @param string $options
|
||||
* @return void
|
||||
*/
|
||||
public function setOptions($options)
|
||||
{
|
||||
if (!empty($options)) {
|
||||
foreach ($options as $key => $value) {
|
||||
$this->setOption($key, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setOption
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $value
|
||||
* @return void
|
||||
*/
|
||||
public function setOption($key, $value)
|
||||
{
|
||||
$name = '_'.$key;
|
||||
$this->$name = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* loadTemplate
|
||||
*
|
||||
|
@ -46,7 +46,7 @@ class Doctrine_Import_Schema
|
||||
'generateTableClasses' => true,
|
||||
'baseClassesDirectory' => 'generated',
|
||||
'baseClassName' => 'Doctrine_Record',
|
||||
'suffix' => '.class.php');
|
||||
'suffix' => '.php');
|
||||
|
||||
/**
|
||||
* getOption
|
||||
|
Loading…
x
Reference in New Issue
Block a user