So, my database now looks like:
Comment -> Commentable
Commentable -> News
Commentable -> Files
Commentable -> Photo
This mean, when i add new entity (file or photo), i have to add new Commentable and insert this value to entity.
What is the best practise of this? Should i override create function of entities, or put it into repository add function?
Structure of tables looks like so, bcz i don't need to create for each entity own comments table.
Edit: My tables schema like here: One table vs multiple tables in Branko Dimitrijevic post
When i want to add new file or event- at first, i have to generate new "Commentable" row and only after that- add with relate my entity.
So, my question, where i have to put this logic or how to do that in the most correct practise?
Thx.