Answer the question
In order to leave comments, you need to log in
How to make dynamic OneToMany in Doctrine?
Hello.
Briefly:
1) The Post entity is inherited from the base Entity class
2) The CustomField entity with three fields:
className, key, value
One post can have many additional fields. fields. All fields are stored in one table. Separated by class_name.
How can I pull out all custom fields through OneToMany, with a specific class_name, which can change depending on the class?
Answer the question
In order to leave comments, you need to log in
This is similar to table inheritance ( inheritance mapping ), but there may be overhead with maintaining such a solution (from other people's words)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question