Conditions | 6 |
Paths | 7 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | public function getVar($type, $object, $original = false, $locale = null) |
||
32 | { |
||
33 | if ($object && \is_object($object)) { |
||
34 | $lang = $this->request ? $this->request->cookies->get('hl') : $this->defaultLocale; |
||
35 | |||
36 | $new_locale = $locale; |
||
37 | if (!$locale) { |
||
38 | $new_locale = $this->request ? $this->request->get('_locale') : $lang; |
||
39 | } |
||
40 | |||
41 | return $object->getVariableByLocale($type, $new_locale, $original); |
||
42 | } |
||
43 | |||
44 | return $type; |
||
45 | } |
||
47 |