From ea507902224a1a08ca920c55b4610f3d976e501f Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Mon, 12 Oct 2015 18:39:46 +0200 Subject: [PATCH] fix(LocalizedString): fix array conversion of locales for LocalizedString --- src/Model/Common/LocalizedString.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Model/Common/LocalizedString.php b/src/Model/Common/LocalizedString.php index e5a0bd6188..e4391b30d8 100644 --- a/src/Model/Common/LocalizedString.php +++ b/src/Model/Common/LocalizedString.php @@ -127,7 +127,13 @@ public function __toString() */ public function toArray() { - return $this->values; + $values = $this->values; + + $data = []; + foreach ($values as $key => $value) { + $data[str_replace('_', '-', $key)] = $value; + } + return $data; } /** @@ -135,13 +141,7 @@ public function toArray() */ public function jsonSerialize() { - $values = $this->toArray(); - - $data = []; - foreach ($values as $key => $value) { - $data[str_replace('_', '-', $key)] = $value; - } - return $data; + return $this->toArray(); } /**