1

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 NotificationLike, 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?

markus
  • 40,136
  • 23
  • 97
  • 142
tamir
  • 3,207
  • 2
  • 33
  • 51
  • Hmm...strange. I have never done concrete inheritance, but with single table inheritance it definitely works. Should work with concrete as well. Maybe the Notification class is marked abstract and can't have any instances. Just a guess – ZolaKt Dec 12 '11 at 12:21
  • Each sub-class has to have a id with FK referencing parent's class id ? – CappY Mar 21 '12 at 22:25

0 Answers0