views:

932

answers:

1

Is there an option in Doctrine that would specify a prefix for any classes generated by doctrine?

I'm having trouble with the new Zend autoloader and autoloading models, the doctrine autoloader doesn't help either.

Ideally I'd have the doctrine generated classes prefixed with 'Model_', as in 'Model_User'.

I ran into this issue while trying to generate migrations using generate-migrations-diff, it says Fatal error: Cannot redeclare class BaseUser in /tmp/fromprfx_doctrine_tmp_dirs/generated/BaseUser.php on line 38

Because the actual model is loaded before the newly generated class.

+2  A: 

Sorry, I was to hasty about asking the question and found the answer seconds later.

Adding:

Doctrine_Manager::getInstance()->setAttribute('model_loading', 'conservative');

Fixed the issue.

Andrei Serdeliuc