K
K
Konstantin Grachev2015-04-24 00:24:01
symfony
Konstantin Grachev, 2015-04-24 00:24:01

How to properly convert data from an entity using data from another entity?

There is a Product table. It contains the Price field containing the price in dollars.
What is the correct way to describe the getPrice() method that returns the price in rubles if the current exchange rate is recorded in the Config table?
Where is the best place to place the connection to the Config table and how to pass the value to the getPrice() method of the Product entity?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2015-04-24
@Preemiere

Count everywhere in one currency. Show me any.
In template {{ product.price|money }}
or {{ product.price|money(app.request.locale) }}
In Twig extension implement this filter (or function)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question