Basically, I need to create a behavior that adds a table and a one-to-many relation to a relation. For example:
Event:
columns: ~
actAs:
Recurrent: ~
Which would be the same as:
Event:
columns: ~
EventRecurrent:
columns:
event_id: integer(4)
relations:
Event:
local: event_id
foreign: id
foreignAlias: RecurrentDates
This is quite the same as what I18n template does, thought it doesn’t generate files, whereas I need to have EventRecurrent and EventRecurrentTable classes generated.
I think this is so complex, you wont find an answer here on Stack Overflow: you will need very deep understanding of how Doctrine works to achieve this.
Since you want to be able to to modify the tables, I think you’re faster off by just defining the models in your model.
If this is not acceptable for your use case, I’d just dive into it: You’ll need your own
Doctrine_Template, probably isDoctrine_Template_I18na good place to start. ThisDoctrine_Template_I18nin turn uses theDoctrine_I18nclass which extendsDoctrine_Record_Generator.If you look at the options of this generator, there’s an option “generateFiles”: setting this to
trueprobably does what you want. But you’ll need a lot of trial and error, probably 🙂