Answer the question
In order to leave comments, you need to log in
How to extract the data of the desired locale?
I managed to implement a record in the database, data in different languages.
Based on the following source.
Writing to the database is as follows
$food = new Category;
$food->setName('Кофе');
$food->addTranslation(new CategoryTranslation('en', 'title', 'Coffee'));
$food->addTranslation(new CategoryTranslation('cn', 'title', '咖啡'));
$food->addTranslation(new CategoryTranslation('en', 'description', 'Description in English'));
$food->addTranslation(new CategoryTranslation('cn', 'description', '英文说明'));
$manager->persist($food);
$manager->flush();
return $message->success("Категория добавлена!");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question