From f2cb5f340949cf5b3d71ea9ed7cc8147798d185b Mon Sep 17 00:00:00 2001 From: neoteknic Date: Tue, 22 Jan 2019 16:39:55 +0100 Subject: [PATCH 1/2] Allow access to raw data of the object --- lib/Resources/BaseResource.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Resources/BaseResource.php b/lib/Resources/BaseResource.php index 1b57446a..13b52a7a 100644 --- a/lib/Resources/BaseResource.php +++ b/lib/Resources/BaseResource.php @@ -64,4 +64,12 @@ public function __toString() $ret .= print_r($this->data, true); return $ret; } + + /** + * Returns the data + * @return \stdClass + */ + public function toArray(){ + return $this->data; + } } From 1922c4b0f57c53767efc93d7d3217a298bc317c1 Mon Sep 17 00:00:00 2001 From: neoteknic Date: Tue, 22 Jan 2019 16:45:16 +0100 Subject: [PATCH 2/2] Allow access to raw data of api object --- lib/Resources/BaseResource.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Resources/BaseResource.php b/lib/Resources/BaseResource.php index 13b52a7a..6afa6230 100644 --- a/lib/Resources/BaseResource.php +++ b/lib/Resources/BaseResource.php @@ -69,7 +69,14 @@ public function __toString() * Returns the data * @return \stdClass */ - public function toArray(){ + public function getData(){ return $this->data; } + /** + * Returns the data array + * @return array + */ + public function toArray(){ + return (array)$this->data; + } }