Doctrine get repository of all models that extends given abstract class

Viewed 716

I have two models: NoteItem and TaskItem. Both extends from AbstractStreamItem:

abstract class AbstractCommentsItem
{
    …
}

class CommentItem extends AbstractCommentsItem
{
    …
}

class TaskItem extends AbstractCommentsItem
{
    …
}

Now I want to get repository of both models in one getRepository command.

Is it possible somehow? I thought about single table inheritance, but not sure if it's the right approach.

1 Answers
Related