F
F
fman22020-11-07 20:25:08
Doctrine ORM
fman2, 2020-11-07 20:25:08

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

1 answer(s)
D
Daria Motorina, 2020-11-09
@fman2

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 question

Ask a Question

731 491 924 answers to any question