PHP Doctrine: Custom nested set?
- by ropstah
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?