Two (or more) models on same table


Is there any built in possibility to use two or more models with one table? For example table pubs and models Articles and Interviews, which in database differs with column type.

For inserting record I can fill type field in beforeCreate, so there is no problem;

But what to do with selecting rows?

The only way, I could think of - is to override find, findFirst and all other select-methods, analyze "condition" field and add somethig like ".. AND type=1" to all queries. But I can not say that I really like this solution.

May be there is another way?

Thank you.

I prefer simpler solution using only one model Pubs. For conditions, you can use query builder andWhere


What I love about andWhere method is, it automatically behaves like where if there is no previous conditions.