M
M
Mike Evstropov2016-07-13 02:45:40
symfony
Mike Evstropov, 2016-07-13 02:45:40

How to organize product images?

There are Product and Category entities associated with ManyToMany. Now we need to attach images to the Product. What is the best way to do this? If you create an Image entity, then what connection should you combine with Product? Or is it better to implement the images field?
It would be great to get an example of such an implementation with images.
Symfony 3

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Kondratiev, 2016-07-13
@Aroused

I would create a separate table (entity) since there can be a lot of photos + sorting + something else, the connection is naturally by product_id.
You can read how to do this
heretytstyts
2 (2.6)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question