Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public function load($resource, $locale, $domain = 'messages') |
||
25 | { |
||
26 | // TODO write just one query join on locale |
||
27 | $language = $this->languageRepository->findOneBy(array( |
||
28 | 'locale' => $locale |
||
29 | )); |
||
30 | |||
31 | $translations = $this->translationsRepository->findBy(array( |
||
32 | 'language' => $language, |
||
33 | 'catalogue' => $domain |
||
34 | )); |
||
35 | |||
36 | $catalogue = new MessageCatalogue($locale); |
||
37 | |||
38 | foreach ($translations as $translation) { |
||
39 | $catalogue->set($translation->getKey(), $translation->getTranslation(), $domain); |
||
40 | } |
||
41 | |||
42 | return $catalogue; |
||
43 | } |
||
44 | } |
||
45 |