Open mcube27 opened 1 year ago
Hi,
I have an article with translated name and description. I use the shadow strategy.
If I want to create multiple translations for an article, I need to pass this:
$article = ArticleFactory::make() ->withArticlesTranslations( [ [ 'id' => 1, 'locale' => 'fr', 'name' => 'Français', 'description' => 'Une phrase', ], [ 'id' => 1, 'locale' => 'en', 'name' => 'English', 'description' => 'A sentence', ], ] ) ->persist();
If I do this, the translations do persist in the database and the id is corrected by cakephp to the article id.
I I omit the 'id', then the translation do not get persisted.
It does not feel intuitive nor very nice to add an id that doesn't mean anything.
I use Cakephp 4.4
normally you should not need to add this id. How is the association between Articles and ArticlesTranslationsdefined in the ArticlesTable and in the ArticlesTranslationsTable?
id
Articles
ArticlesTranslations
ArticlesTable
ArticlesTranslationsTable
Hi,
I have an article with translated name and description. I use the shadow strategy.
If I want to create multiple translations for an article, I need to pass this:
If I do this, the translations do persist in the database and the id is corrected by cakephp to the article id.
I I omit the 'id', then the translation do not get persisted.
It does not feel intuitive nor very nice to add an id that doesn't mean anything.
I use Cakephp 4.4