Question

I have in my model defined two entities linked by a one-to-one relationship:

User:  
  columns: 
    home_address_id: integer
  relations:
    HomeAddress:
      class: Address
      local: home_address_id
      foreignType: one

Address:
  columns: 
    zip: string
    city: string

When I use the generator, my form includes all fields of the User object, including a dropdown list to select an address.

What I would like is to be able to enter directly the Zip and City of the user's home address. How to request this to be generated in the generator.yml file? Do I have to implement some code to do it myself or is there a way for it to be automatic?

Was it helpful?

Solution

I haven't designed anything with a one to one relationship or seen it in the symfony docs. It looks to me like it's treating it the same as a one to many relationship.

I think all you have to do to work around it, though, is to use embedded forms.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top