You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I am new in Symfony and I am working with this example: I have an Entity Called TypeOfAdmission which has an attribute called plans which is an array. Because of this, the relation between the entities TypeOfAdmission and Plan is from OneToMany. In the entity called Plan I have other attribute called subjects which is an array. Because of this, the relation between the entities Plan and Subject is from OneToMany...
It's like this: TypeOfAdmission -> Plan -> Subject ...
The problem is that when I am registering an instance of TypeOfAdmission I request to register Plans and the plans request subjects, everything goes well, but when saving it, the array of plans are saved well, but the array of subjects from every plan just get the last item registered.
I register this:
Admission Type 1
Plan 1
Subject 1
Subject 2
Plan 2
Subject 3
Subject 4
But on my database it is saved like this:
Admission Type 1
Plan 1
Subject 2
Plan 2
Subject 4
Anybody has had the same trouble?
Hope you can help me.
Thx in advance.
The text was updated successfully, but these errors were encountered:
Can you make an actual code example? Meanwhile, check https://gist.github.com/Ocramius/3121916, as it should clarify that you are responsible for setting all sides of the associations.
Hello. I am new in Symfony and I am working with this example: I have an Entity Called TypeOfAdmission which has an attribute called plans which is an array. Because of this, the relation between the entities TypeOfAdmission and Plan is from OneToMany. In the entity called Plan I have other attribute called subjects which is an array. Because of this, the relation between the entities Plan and Subject is from OneToMany...
It's like this: TypeOfAdmission -> Plan -> Subject ...
The problem is that when I am registering an instance of TypeOfAdmission I request to register Plans and the plans request subjects, everything goes well, but when saving it, the array of plans are saved well, but the array of subjects from every plan just get the last item registered.
I register this:
Admission Type 1
Plan 1
Subject 1
Subject 2
Plan 2
Subject 3
Subject 4
But on my database it is saved like this:
Admission Type 1
Plan 1
Subject 2
Plan 2
Subject 4
Anybody has had the same trouble?
Hope you can help me.
Thx in advance.
The text was updated successfully, but these errors were encountered: