Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion problems w/ forms & doctrine ManyToMany bi-directional relations
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marco Pivetta  
View profile  
 More options Oct 8 2012, 5:12 am
From: Marco Pivetta <ocram...@gmail.com>
Date: Mon, 8 Oct 2012 11:12:13 +0200
Local: Mon, Oct 8 2012 5:12 am
Subject: Re: [Symfony2] Re: problems w/ forms & doctrine ManyToMany bi-directional relations

Ok, my knowledge about SF2 stops here :)
At this point, you will need to tell your form to use your `add` and
`remove` methods when adding or removing items. It is probably acting on
the collection itself right now.

Marco Pivetta

http://twitter.com/Ocramius

http://marco-pivetta.com

On 8 October 2012 11:07, Hugo Fisch <goo...@barton-online.ch> wrote:

> Alright :)
> The methods are up2date, or did I miss something?

> http://pastebin.com/SuRB8kDF
> http://pastebin.com/ZyDse7RZ

> On Monday, 8 October 2012 10:51:55 UTC+2, Marco Pivetta wrote:

>> Oh, don't worry about the annotations. The important bit is about the
>> methods that handle the association ;)

>> Marco Pivetta

>> http://twitter.com/Ocramius   **

>> http://marco-pivetta.com

>> On 8 October 2012 10:46, Hugo Fisch <goo...@barton-online.ch> wrote:

>>> Hi

>>> Thank you for the reply, I really appreciate it!

>>> Are you sure I've to specify the columns, because there are no columns
>>> specified in the mapping association examples:
>>> http://docs.doctrine-project.**org/en/2.0.x/reference/**
>>> association-mapping.html#many-**to-many-bidirectional<http://docs.doctrine-project.org/en/2.0.x/reference/association-mappi...>

>>> Though I've updated my Host entity and added both join columns
>>> (joinColumns & inverseJoinColumns).
>>> Still the same behaviour - I can't save the form on the inverse side.

>>> Btw. is that correct: In your examples, you've defined mappedBy and
>>> inversedBy as "blocks"?

>>> Cheers
>>> Domi

>>> On Monday, 8 October 2012 09:59:23 UTC+2, Marco Pivetta wrote:

>>>> Try fixing your entities:
>>>> https://gist.github.com/**312191**6 <https://gist.github.com/3121916>

>>>> Marco Pivetta

>>>> http://twitter.com/Ocramius   ****

>>>> http://marco-pivetta.com

>>>> On 8 October 2012 09:15, Hugo Fisch <goo...@barton-online.ch> wrote:

>>>>> no one an idea?

>>>>> On Tuesday, 2 October 2012 15:52:22 UTC+2, Hugo Fisch wrote:

>>>>>> Hi

>>>>>> I've the following setup:

>>>>>> - Symfony 2.1.2
>>>>>> - Host Entity
>>>>>> - HostGroup Entity

>>>>>> Each Host can be in multiple groups and each group can hold multiple
>>>>>> hosts (i.e. ManyToMany bi-directional relation).
>>>>>> The Host entity is the owing side, while the HostGroup entity is the
>>>>>> inverse side.

>>>>>> Host entity: http://pastebin.com/**Pa****C3Rwwx<http://pastebin.com/PaC3Rwwx>
>>>>>> HostGroup entity: http://pastebin.com/**RE****qwaHNx<http://pastebin.com/REqwaHNx>

>>>>>> I've created a form via Symfony console and everything is working,
>>>>>> except *that I can't save the hosts in the hostgroup form (inverse
>>>>>> side)*.
>>>>>> I can add/remove host groups in the hosts form, but I can't
>>>>>> add/remove hosts in the host group form.

>>>>>> Cascading is working, because when I create a new host group, add an
>>>>>> existing host to the group and persist() the group entity, everything works
>>>>>> as expected (test case  http://pastebin.com/**RFSK****a5Cq<http://pastebin.com/RFSKa5Cq>
>>>>>> ).

>>>>>> Somehow the form bind() method is not saving the hosts on the inverse
>>>>>> side.

>>>>>> Is this my failure? Is there something I've to change or is there a
>>>>>> tip how to debug the whole thing correctly?

>>>>>> Cheers
>>>>>> Domi

>>>>>>  --
>>>>> If you want to report a vulnerability issue on symfony, please send it
>>>>> to security at symfony-project.com

>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Symfony2" group.
>>>>> To post to this group, send email to symf...@googlegroups.com

>>>>> To unsubscribe from this group, send email to
>>>>> symfony2+u...@**googlegroups.com

>>>>> For more options, visit this group at
>>>>> http://groups.google.com/**group**/symfony2?hl=en<http://groups.google.com/group/symfony2?hl=en>

>>> --
>>> If you want to report a vulnerability issue on symfony, please send it
>>> to security at symfony-project.com

>>> You received this message because you are subscribed to the Google
>>> Groups "Symfony2" group.
>>> To post to this group, send email to symf...@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> symfony2+u...@**googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/**group/symfony2?hl=en<http://groups.google.com/group/symfony2?hl=en>

>>  --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com

> You received this message because you are subscribed to the Google
> Groups "Symfony2" group.
> To post to this group, send email to symfony2@googlegroups.com
> To unsubscribe from this group, send email to
> symfony2+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony2?hl=en


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.