Commit dc90cca9 authored by Jonathan.Wage's avatar Jonathan.Wage

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

parent f59131f0
......@@ -32,7 +32,7 @@
*/
class Doctrine_Search
{
protected $_options = array('generateFiles' => true,
protected $_options = array('generateFiles' => false,
'className' => '%CLASS%Index');
......@@ -194,11 +194,20 @@ class Doctrine_Search
$builder = new Doctrine_Import_Builder();
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);
if ( ! $this->_options['generateFiles']) {
eval($def);
}
return true;
}
}
\ No newline at end of file
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