PHP Doctrine:自定义嵌套集?
在这个有点自定义的设置中是否可以具有嵌套集功能?
考虑这 4 个表:
- 对象:(
oid
,name
) 包含:[1, '许可证'] 和 [2, '豁免']- 许可证:(
盖子
、名称
)- 豁免:(
eid
,姓名
)- 成本:(
oid
、oid_ref
、cost_oid
、cost_oid_ref
)< /里>
对于:< br> P = 带盖子
的许可证 [1]
R = 带有 eid
的豁免 [2]
我可以说“对象 P 是对象 的父级 R”如果存在以下成本记录:
[oid: 2 oid_ref: 2 成本:1 cost_oid_ref: 1]
我知道这会创建某种我需要在代码中定义的“条件外键”关系。 是否可以使用这些条件加载嵌套集?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我正在尝试以某种方式使用 column_aggregation 继承,但我有一种直觉,它不会起作用......:S
I am trying in some way using column_aggregation inheritance, but I have a gut feeling it's not gonna work... :S