@@ 113-124 (lines=12) @@ | ||
110 | * @param $array |
|
111 | * @return array |
|
112 | */ |
|
113 | private function flatten($array, $prefix = '') { |
|
114 | $result = []; |
|
115 | foreach($array as $key=>$value) { |
|
116 | if(is_array($value)) { |
|
117 | $result = $result + $this->flatten($value, $prefix . $key . '.'); |
|
118 | } |
|
119 | else { |
|
120 | $result[$prefix . $key] = $value; |
|
121 | } |
|
122 | } |
|
123 | return $result; |
|
124 | } |
|
125 | ||
126 | /** |
|
127 | * Get translations for export. |
@@ 222-233 (lines=12) @@ | ||
219 | * @param $array |
|
220 | * @return array |
|
221 | */ |
|
222 | private function flatten($array, $prefix = '') { |
|
223 | $result = []; |
|
224 | foreach($array as $key=>$value) { |
|
225 | if(is_array($value)) { |
|
226 | $result = $result + $this->flatten($value, $prefix . $key . '.'); |
|
227 | } |
|
228 | else { |
|
229 | $result[$prefix . $key] = $value; |
|
230 | } |
|
231 | } |
|
232 | return $result; |
|
233 | } |
|
234 | ||
235 | /** |
|
236 | * @return string |