I'm unsure how to set up the models and relationships for this
situation.

I have a nodes table, these nodes have a hierarchy to them where one or
more nodes may be a parent to another node in this table.  To create
the links, I have a node_parents table that links the node_id to the
parent_id.

It's pretty straight forward sql, joining the same table twice on the
different keys. but I don't have a clue how to set this up with cake.
Any help would be appreciated.


The important fields in the tables are like this:
nodes (id,name)
node_parents(node_id,parent_id)

The kind of sql that would I would use to find parents would be like:

select a.id, a.name, b.parent_id, c.name as parent_name
from nodes a, node_parents b, nodes c
where a.id=b.node_id
and b.parent_id=c.id
and ...


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to