1
0
mirror of synced 2025-01-18 22:41:43 +03:00

Fix for the creating of files and the path to create them at.

This commit is contained in:
Jonathan.Wage 2007-10-03 18:57:24 +00:00
parent f59131f010
commit dc90cca915

View File

@ -32,7 +32,7 @@
*/
class Doctrine_Search
{
protected $_options = array('generateFiles' => true,
protected $_options = array('generateFiles' => false,
'className' => '%CLASS%Index');
@ -193,12 +193,21 @@ class Doctrine_Search
$columns += $fk;
$builder = new Doctrine_Import_Builder();
$def = $builder->buildDefinition($options, $columns, $relations);
if ( ! $this->_options['generateFiles']) {
eval($def);
if ($this->_options['generateFiles']) {
if (isset($this->_options['generatePath']) && $this->_options['generatePath']) {
$builder->setTargetPath($this->_options['generatePath']);
$builder->buildRecord($options, $columns, $relations);
} else {
throw new Doctrine_Search_Exception('If you wish to generate files then you must specify the path to generate the files in.');
}
} else {
$def = $builder->buildDefinition($options, $columns, $relations);
eval($def);
}
return true;
}
}
}