I'm working with Symfony 4.4,
For security reason, when submitting OrderProduct entity that embedd Product entity, I have to control some values of OrderProduct taken from Product.
So, it's an Symfony API, I receive an orderProduct in a JSON format:
{
"product" : { "id" : 82 },
"price" : 9.7,
"quantity": 3,
//...
}
I have to get the product from the database, to test if the price is correct.