C
C
Celsius2017-12-13 13:59:28
symfony
Celsius, 2017-12-13 13:59:28

How to work with localization in doctrine?

There are 2 languages: ru, en.
The names of the fields in the table are named after the name of the locale (i.e. the field with Russian text is called ru, from English en).
Previously, in order to immediately get an entry in the desired locale (the locale in the $lang variable), it was enough to make a request like: How now, is it more elegant to work with entities and methods like: MyTable->getRu and MyTable->getEn in symphony?
"SELECT id, $lang FROM my_table"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
voronkovich, 2017-12-14
@Cels

Translatable behavior extension for Doctrine 2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question