| Simple One-to-many with doctrine [message #95766] |
Fri, 19 March 2010 10:37  |
symfonyParis Messages: 13 Registered: February 2010 |
Junior Member |
|
|
Hi symfonians,
This is simple, but i can't do a simple one-to many relation in my schema.yml. I want a user to have many profiles. When editing a user, a profile should be a mandatory multiple select. What is the best way to schematize it in my schema.yml with doctrine?
Thanks a lot for any help.
|
|
|
|
|
| Re: Simple One-to-many with doctrine [message #95799 is a reply to message #95795 ] |
Fri, 19 March 2010 14:57   |
symfonyParis Messages: 13 Registered: February 2010 |
Junior Member |
|
|
Ok, i remove the integer lenght (4) in Profile:columns:user_id and doctrine:build worked
but it's not what i wanted, i think i have to reverse user and profile, to get on user edition the selection of profiles and not users selection on the profile edition, i'll try..
Also, i don't have the possibility of multiple selection. Is there any way to put something in schema.yml to have it???
Thanks again
Ps: attachment with two forms
Attachment: screen.JPG
(Size: 14.62KB, Downloaded 62 time(s))
|
|
|
|
| Re: Simple One-to-many with doctrine [message #96121 is a reply to message #95766 ] |
Wed, 24 March 2010 14:18  |
abo3ans Messages: 21 Registered: February 2010 |
Junior Member |
|
|
if you want one company has many categories try this
Company:
columns:
name: { type: string(255) }
Category:
columns:
company_id: { type: integer(4), notnull: true }
field: { type: string(255), notnull: true }
relations:
Company: { local: company_id, foreign: id, onDelete:CASCADE }
but this is the simple way try it with the true fields which you want to use
try it and tell me
|
|
|