0

On symfony 6.2, I am using DoctrineExtensions package for slug generation. For translation, I am using KNP DoctrineBehaviors.

The generated slug (based on the title field) should be unique but only per language. So if in english, the title is "test" and in french, it's "test" too, I should get "test" for both language for the slug (not "test-1" for french).

In the translation table, I do have a "locale" field.

I have so added at entity class level the following constraint:

#[ORM\UniqueConstraint(name: 'slug_unique', columns: ['slug', 'locale'])] // columns name, not field name

but this does not work.

Any idea on how I could do?

Thx!

Vénizia
  • 581
  • 5
  • 14

0 Answers0