[EMAIL PROTECTED] wrote:
>> Paul, this is (a very nicely presented) example of what I was suggesting
>> in my reply to your original post (I was too lazy to dig up the code
>> unlike Conners).
>>
>> In my opinion this solution is much better than using HABTM for this
>> problem as you have complete control over the join table, the
>> relationships, and can even store extra data in the join table to help
>> describe the relationship if you need/want to.
>>
>> So I would recommend this approach too.
>>
>> Regards,
>> Langdon
> 
> Hi Langdon,
> 
> I've actually used this approach and gotten it to work and it works
> great if each row in the database references only one parent row.
> However, my issue is that one row in the database could have several
> parents and several children.  That's why I have a join table.
> 
> Basically in my navigation there could be Item1 with a child of
> Item2.  At the same time Item3 could have the child Item2 as well.
> Therefore, Item2 has two parents.  Item2 could also have Item4, Item5,
> etc as children and Item4 could be a child of Item1 etc.
> 
> That is the relationship that I'm trying to figure out with cake if
> its possible.
> 
> Is there away around this using the code that Conners has posted that
> I'm just not seeing?

Hi Paul

My mistake.  I was forgetting the join table (end of the week, late 
night etc).  But the approach is still the same.

Use the same style of relationships, but add a join table in between. 
It is another way of producing a HABTM association.  Only you are doing 
it "manually".

So:

   table1 hasMany JoinTable
   JoinTable hasMany table1

(this is your child relationship)

and

   table1 belongsTo JoinTable
   JoinTable belongsTo table1

(this is your parent relationship)

If you search this forum for info on "adding data to join tables" or 
similar, you will find this design discussed a number of times.

Regards,
Langdon

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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