开发者

Doctrine Inheritance: find all children of a table

开发者 https://www.devze.com 2023-04-11 16:44 出处:网络
I have a question about Table Inheritance in Doctrine. for an example I\'ll use 3 tables: Notification:

I have a question about Table Inheritance in Doctrine. for an example I'll use 3 tables:

Notification:
  columns:
    id
    is_viewed

NotificationLike:
  columns:
    like_id
  inheritance: { type: concrete, extends: Notification }

NotificationComment:
  columns:
    comment_id
  inheritance: { type: concrete, extends: Notification }

As you can see, there is a parent table Notification and two child tables Notificati开发者_JAVA技巧onLike, NotificationComment that use concrete inheritance to extend the parent table.

I want to get all the Notifications. how can i do it without some kind of JOIN?

If i try Doctrine_Core::getTable('Notification')->findAll() i get 0 records.

Any ideas?

0

精彩评论

暂无评论...
验证码 换一张
取 消