From f60dfa54153c032d231200bb2998568a55452a0a Mon Sep 17 00:00:00 2001 From: Adam Greer Date: Thu, 26 Nov 2015 10:05:35 +0000 Subject: [PATCH] Return NULL value for Undefined Return a NULL value from the data object when no data is set in the XML file --- src/XeroPHP/Remote/Object.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/XeroPHP/Remote/Object.php b/src/XeroPHP/Remote/Object.php index 4c9e5384..40be7344 100644 --- a/src/XeroPHP/Remote/Object.php +++ b/src/XeroPHP/Remote/Object.php @@ -167,8 +167,10 @@ public function fromStringArray($input_array, $replace_data = false) { continue; } - if(!isset($input_array[$property])) + if(!isset($input_array[$property])) { + $this->_data[$property] = null; continue; + } //Fix for an earlier assumption that the API didn't return more than two levels of nested objects. //Handles Invoice > Contact > Address etc. in one build.