Index: task/sfDoctrineBuildModelTask.class.php =================================================================== --- task/sfDoctrineBuildModelTask.class.php (revision 25246) +++ task/sfDoctrineBuildModelTask.class.php (working copy) @@ -73,7 +73,12 @@ // markup base classes with magic methods foreach (sfYaml::load($schema) as $model => $definition) { - $file = sprintf('%s%s/%s/Base%s%s', $config['models_path'], isset($definition['package']) ? '/'.substr($definition['package'], 0, strpos($definition['package'], '.')) : '', $builderOptions['baseClassesDirectory'], $model, $builderOptions['suffix']); + if (isset($definition['custom_path'])) { + $file = sprintf('%s%s/%s/Base%s%s', $config['models_path'].'/'.$definition['custom_path'], isset($definition['package']) ? '/'.substr($definition['package'], 0, strpos($definition['package'], '.')) : '', $builderOptions['baseClassesDirectory'], $model, $builderOptions['suffix']); + } else { + $file = sprintf('%s%s/%s/Base%s%s', $config['models_path'], isset($definition['package']) ? '/'.substr($definition['package'], 0, strpos($definition['package'], '.')) : '', $builderOptions['baseClassesDirectory'], $model, $builderOptions['suffix']); + } + $code = file_get_contents($file); // introspect the model without loading the class Index: vendor/doctrine/Doctrine/Import/Builder.php =================================================================== --- vendor/doctrine/Doctrine/Import/Builder.php (revision 6935) +++ vendor/doctrine/Doctrine/Import/Builder.php (working copy) @@ -1106,8 +1106,13 @@ // If is package then we need to put it in a package subfolder if (isset($definition['is_package']) && $definition['is_package']) { $writePath = $this->_path . DIRECTORY_SEPARATOR . $definition['package_name']; - // Otherwise lets just put it in the root of the path - } else { + + // If it is custom_path is specified + } else if (isset($definition['custom_path'])) { + $writePath = $this->_path . DIRECTORY_SEPARATOR . $definition['custom_path'] . DIRECTORY_SEPARATOR; + } + // Otherwise lets just put it in the root of the path + else { $writePath = $this->_path; } @@ -1133,6 +1138,11 @@ if (isset($definition['is_package']) && $definition['is_package']) { $basePath = $this->_path . DIRECTORY_SEPARATOR . $definition['package_name']; $writePath = $basePath . DIRECTORY_SEPARATOR . $this->_baseClassesDirectory; + + // If a custom_path is specified + } else if (isset($definition['custom_path'])) { + $writePath = $this->_path . DIRECTORY_SEPARATOR . $definition['custom_path'] . DIRECTORY_SEPARATOR . $this->_baseClassesDirectory; + // Otherwise lets just put it in the root generated folder } else { $writePath = $this->_path . DIRECTORY_SEPARATOR . $this->_baseClassesDirectory; Index: vendor/doctrine/Doctrine/Import/Schema.php =================================================================== --- vendor/doctrine/Doctrine/Import/Schema.php (revision 6935) +++ vendor/doctrine/Doctrine/Import/Schema.php (working copy) @@ -48,7 +48,9 @@ 'package', 'package_custom_path', 'inheritance', - 'detect_relations'); + 'detect_relations', + 'custom_path', + ); /** * _relations @@ -100,6 +102,7 @@ 'options', 'package', 'package_custom_path', + 'custom_path', 'inheritance', 'detect_relations', 'listeners',