Witam,

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

Zapytanie, które wyciągnie mi wszystkie rekordy na podstawie _locale:
  1. SELECT * FROM country
  2. INNER JOIN country_tranlation ON country_tranlation.coutnry_translation_country_id = country.country_id
  3. INNER JOIN LANGUAGE ON LANGUAGE.language_id = country_tranlation.country_translation_language_id
  4. WHERE anguages.language_code = 'pl'
Problem w tym jak ten cały proces zautomatyzować do tego stopnia:
  1. $country = $countryRepository->find(1);
...zamiast...:
  1. $country = $countryRepository->findByIdAndLanguageCode(1, 'pl');
Czy sam listener wystarczy?