Hey thanks a lot for this information.

Do you know how to handle this when you have multiple People to be
attached to the same Match, along with the roles?

On Sep 16, 12:08 pm, Dérico Filho <[EMAIL PROTECTED]> wrote:
> Just solved it:
>
>                 $this->Match->save(
>                         Array(
>                                 "Match" => Array(
>                                         "id" => $match_id
>                                 ),
>                                 "Person" => Array(
>                                         "Person" => Array(
>                                                 Array(
>                                                         "person_id" => 
> $main_referee_id,
>                                                         "role" => 
> 'main_referee'
>                                                 )
>                                         )
>                                 )
>                         )
>                 );
>
> On Sep 16, 12:57 pm, Dérico Filho <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I have two tables:
>
> > matches
> > people
>
> > linked together by:
>
> > matches_people
>
> > Well, on the matches_people table there are other fields but match_id
> > and person_id, for instance: role, a enum type field.
>
> > The question is how do I save data into matches_people in way I can
> > also update the role field?
>
> > I've tried:
> >                 $this->Match->save(
> >                         Array(
> >                                 "Match"       => Array( "id"   => $match_id 
> >        ),
> >                                 "Person"      => Array( "id"   => 
> > $main_referee_id ),
> >                                 "MatchPerson" => Array( "role" => 
> > "main_referee"   )
> >                         )
> >                 );
>
> > But it did not work out, how do I do it?
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to