diff --git a/src/Wuunder/Model/Model.php b/src/Wuunder/Model/Model.php index 0ec3817..9605c4f 100644 --- a/src/Wuunder/Model/Model.php +++ b/src/Wuunder/Model/Model.php @@ -85,7 +85,7 @@ private function loopInnerData($data, $keysMap, $keysToTranslate) foreach ($data as $key => $value) { if (array_key_exists($key, $keysMap) || is_object($value)) { if (is_object($value)) { - array_push($validatedData, $this->loopInnerData($value, $this->_isAssoc($keysMap) ? $keysMap[$key] : $keysMap[0], $keysToTranslate)); + $validatedData[$key] = $this->loopInnerData($value, $this->_isAssoc($keysMap) ? $keysMap[$key] : $keysMap[0], $keysToTranslate); } elseif (is_array($value)) { $validatedData[$key] = $this->loopInnerData($value, $keysMap[$key], $keysToTranslate); } else { diff --git a/src/Wuunder/Model/ParcelshopsModel.php b/src/Wuunder/Model/ParcelshopsModel.php index e759777..9c5dfe3 100644 --- a/src/Wuunder/Model/ParcelshopsModel.php +++ b/src/Wuunder/Model/ParcelshopsModel.php @@ -16,7 +16,11 @@ public function __construct($data) "street_name", "state", "house_number", - "city" + "city", + "phone_number", + "email_address", + "country_name", + "alpha2" ), "location" => array( "lng", diff --git a/src/Wuunder/Util/Helper.php b/src/Wuunder/Util/Helper.php index 268f1eb..49560bc 100644 --- a/src/Wuunder/Util/Helper.php +++ b/src/Wuunder/Util/Helper.php @@ -76,7 +76,7 @@ public function translate($val) { global $translationData; - if (!in_array(strtolower($val), $translationData)) { + if (is_array($translationData) && !in_array(strtolower($val), $translationData)) { $translatedVal = $translationData[strtolower($val)]; if ($this->_startsWithUpper($val)) { $translatedVal = ucfirst($translatedVal);