PHP Doctrine: Custom nested set?
Posted
by ropstah
on Stack Overflow
See other posts from Stack Overflow
or by ropstah
Published on 2010-04-03T22:12:39Z
Indexed on
2010/04/03
22:13 UTC
Read the original article
Hit count: 377
Is it possible to have nested set capabilities in this somewhat custom setup?
Consider these 4 tables:
- Object: (
oid
,name
) contains: [1, 'Licence'] and [2, 'Exemption']- Licence: (
lid
,name
)- Exemption: (
eid
,name
)- Cost: (
oid
,oid_ref
,cost_oid
,cost_oid_ref
)
For:
P = Licence with lid
[1]
R = Exemption with eid
[2]
i can say "object P is a parent to object R" if the following Cost record exists:
[oid: 2
oid_ref: 2
cost_oid: 1
cost_oid_ref: 1]
I understand that this creates somesort of 'conditional foreign key' relation which I need to define in code. Is it possible to have the nested set loaded with these conditions?
© Stack Overflow or respective owner