tags:

views:

170

answers:

2

Hi, I build zend app with doctrine. The problem is when i add new tables to database and I should generate doctrine models, because I add my own code to Doctine generated classes- I dont wont to delete them. I solve this problem like that: 1. copy old generated doctine models classes to other folder 2. generate doctrine models from database 3. remove same new doctrine models class with old

I think my solution stupied, but i cant think about something else. Please help me, Thanks, Yosef

+3  A: 

Only base classes are overwritten when they already do exist.

Do not modify them. Put your custom code in models extending base classes, so your code will keep unchanged upon next model generation.

You may take a look at service layer as well, as a method for separating your model layer.

And one more advice: if you repeat the same thing over and over, it is best to automate this, eg. using Phing.

takeshin
A: 

thanks you very much!

Yosef