when i tried to use symfony2 doctrine reverse engineering tools, I have a one to many relationship. for example:
A: id, name; B: id, a_id, name
so the reverse engineering tools give me something like:
class A{
private id;
private name;
}
class B{
private id,
private A a;
private name;
}
but what I need is :
class A{
private id;
private Bs;
private name;
}
How can I make doctrine tools generate this for me ? because the data is changing and I do not want to rewrite every time the database changes.
I am sorry to be the bringer of bad news, but you can’t. The only option is to generate the entities and then add the specifics yourself.
http://readthedocs.org/docs/doctrine-orm/en/2.0.x/reference/tools.html#entity-generation