Answer the question
In order to leave comments, you need to log in
Symfony how to properly store multiple property?
Hello, how to store multiple properties correctly?
For example, a user can have 2 phones (optional property).
Thank you.
Answer the question
In order to leave comments, you need to log in
In general, if you do not need to access these elements separately at the database level (i.e. you do not need, for example, to select only one of the phones in the query), then you can use an array and use the array
or type json_array
for mapping. For a complete list of types, see the Doctrine documentation .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question