Hi!
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.