v2.1.0 — Locale Variant DX Improvements
What's New
Three quality-of-life improvements that reduce consumer boilerplate for locale variant workflows.
Auto-reset generated IDs (#7)
TranslatableEntityHandler now automatically resets properties with #[ORM\Id] + #[ORM\GeneratedValue] to null on cloned translations. No more reflection boilerplate in consumer code.
translateAndPersist() and getOrTranslate() (#8)
Two new convenience methods on EntityTranslatorInterface:
translateAndPersist()— translate + persist in one callgetOrTranslate()— returns existing translation or creates + persists a new one
TranslatableRepositoryTrait (#9)
A new trait for Doctrine entity repositories with batch locale variant queries:
findAllLocaleVariants(Tuuid)— all locale variants keyed by localefindAllLocaleVariantsBatch(list<Tuuid>)— batch lookup grouped by tuuid then locale
Both methods temporarily disable the locale filter to query across all locales.
Stats
- 422 tests, 2794 assertions
- 100% code coverage (1094/1094 lines)
- PHPStan level max: 0 errors