Re: Problems with "hasAndBelongsToMany"

2007-03-07 Thread [EMAIL PROTECTED]

I believe that would be the best approach. Then you would just have to
do one save, using the joining table for the current record. And of
course using that method, there could be any number of fields in the
joining table.

On Mar 6, 8:23 am, "Grant Cox" <[EMAIL PROTECTED]> wrote:
> To have more than just the two foreign ids, then you need a join model
> in the middle.  There was word that the HABTM relationship will be
> extended to allow this to be through a model, but I don't think this
> is implemented yet.  In the meantime, you need to make the middle
> model and associate it yourself - ie:
>
> Profile hasMany EventProfile
> Event hasMany EventProfile
> EventProfile belongsTo Profile,Event
>
> this EventProfile will be a new model, which uses your join table, and
> can have whatever additional data it likes.  You will then need to
> manage creating/removing these joins in your application yourself.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Problems with "hasAndBelongsToMany"

2007-03-06 Thread fr3nch13

Im not sure if this thread is relevant anymore, but it may help:
http://groups.google.com/group/cake-php/browse_thread/thread/b01e21968ce9a151/1af66e7bae2685df

search the group for habtm

On Mar 6, 3:49 am, "superjean" <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I have some problems with that kind of association in cakePHP.
>
> There are two models: Profile and Event. And the table which joins
> them together is `event_profiles` (event_id, profile_id, date). Date
> is necessary. It is simple to save event_id and profile_id using
> standard ways, but I experience difficulties saving `date` in the
> table.
>
> Did someone solve similar problems?
>
> Thank you.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Problems with "hasAndBelongsToMany"

2007-03-06 Thread Grant Cox

To have more than just the two foreign ids, then you need a join model
in the middle.  There was word that the HABTM relationship will be
extended to allow this to be through a model, but I don't think this
is implemented yet.  In the meantime, you need to make the middle
model and associate it yourself - ie:

Profile hasMany EventProfile
Event hasMany EventProfile
EventProfile belongsTo Profile,Event

this EventProfile will be a new model, which uses your join table, and
can have whatever additional data it likes.  You will then need to
manage creating/removing these joins in your application yourself.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Problems with "hasAndBelongsToMany"

2007-03-06 Thread superjean

Hello all,

I have some problems with that kind of association in cakePHP.

There are two models: Profile and Event. And the table which joins
them together is `event_profiles` (event_id, profile_id, date). Date
is necessary. It is simple to save event_id and profile_id using
standard ways, but I experience difficulties saving `date` in the
table.

Did someone solve similar problems?

Thank you.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---