L
L
liteppuano2018-08-14 16:00:31
symfony
liteppuano, 2018-08-14 16:00:31

Similar entities in symfony (doctrine). Is it possible to pass through the model?

Hello. I just understand the Symphony and the doctrine and immediately hit a dead end on how best to do it.
Task: There is an entity. It is necessary to find similar entities according to certain criteria. e.g. Product - similar products.
I want to implement this as a property of the (related) type model, so that it can be used in different parts of the site without unnecessary gestures in the controllers.
Is it possible? I don't want to override rest methods for this.
perhaps you can make a connection of the ManyToOne type with some kind of filters for the same model

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skobkin, 2018-08-14
@skobkin

Possibly, but most likely not a good idea.
Because to search for similar products, most likely, you will need quite fat logic, and maybe even some kind of search engine or something else - depending on the requirements. And this already needs to be done in the service.
Also what you not to override a method will push service in essence?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question