| Conditions | 4 |
| Paths | 6 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | private function getTranslatedCountryNames($countries) |
||
| 41 | { |
||
| 42 | if (in_array($this->countryCode, ['DEU', 'AUT'])) { |
||
| 43 | $select = 'countryname'; |
||
| 44 | } else { |
||
| 45 | $select = 'countryen'; |
||
| 46 | } |
||
| 47 | |||
| 48 | $translatedCountries = $this->db->fetchAssoc( |
||
| 49 | "SELECT iso3, {$select} as `name` FROM s_core_countries WHERE iso3 IN ({$this->db->quote($countries)})" |
||
| 50 | ); |
||
| 51 | |||
| 52 | foreach ($countries as &$country) { |
||
| 53 | $translation = $translatedCountries[$country]['name']; |
||
| 54 | if (!empty($translation)) { |
||
| 55 | $country = $translation; |
||
| 56 | } |
||
| 57 | } |
||
| 58 | |||
| 59 | return $countries; |
||
| 60 | } |
||
| 61 | } |
||
| 62 |