szukam alternatywy dla StofDoctrineExtensionsBundle, a dokładniej mówiąc dla rozszerzenia Translatable. W Google nie znalazłem żadnego rozwiązania, które by mi odpowiadało dlatego myślę o czymś własnym.
Przykładowa struktura tabel:
Kod
* language
language_id
language_name
language_code
* country
country_id
country_name
country_name_alias
* country_tranlation
country_translation_id
country_translation_language_id
country_translation_country_id
country_translation_country_name
country_translation_country_name_alias
language_id
language_name
language_code
* country
country_id
country_name
country_name_alias
* country_tranlation
country_translation_id
country_translation_language_id
country_translation_country_id
country_translation_country_name
country_translation_country_name_alias
Zapytanie, które wyciągnie mi wszystkie rekordy na podstawie _locale:
Problem w tym jak ten cały proces zautomatyzować do tego stopnia:
SELECT * FROM country INNER JOIN country_tranlation ON country_tranlation.coutnry_translation_country_id = country.country_id INNER JOIN LANGUAGE ON LANGUAGE.language_id = country_tranlation.country_translation_language_id WHERE anguages.language_code = 'pl'
...zamiast...:
$country = $countryRepository->find(1);
Czy sam listener wystarczy?
$country = $countryRepository->findByIdAndLanguageCode(1, 'pl');