I
I
Igor2020-01-20 09:18:23
symfony
Igor, 2020-01-20 09:18:23

Symfony 5, translating database content, who managed to implement it?

I tried to realize my idea.
Is it worth saying that it didn't work?
Sources.
Translating-database-content
DoctrineBehaviors
The example is outrageously simple.
It works like this

$category = new Category();
        $category->translate("ru")->setName("Вася");
        $category->translate("en")->setName("Vasy");

       $manager->persist($category);
       $category->mergeNewTranslations();

Bands are connected
5e254965b89a2509202012.png
What is missing to make it work?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question