From 1533ecde1f65ca0a16870026fae8cf3fabdc04d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Polles?= Date: Thu, 8 Apr 2021 09:42:39 -0300 Subject: [PATCH 1/2] created method getLastCall to get __getLastRequest from a service --- src/Artisaninweb/SoapWrapper/SoapWrapper.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Artisaninweb/SoapWrapper/SoapWrapper.php b/src/Artisaninweb/SoapWrapper/SoapWrapper.php index 9c611e1..7c1023d 100644 --- a/src/Artisaninweb/SoapWrapper/SoapWrapper.php +++ b/src/Artisaninweb/SoapWrapper/SoapWrapper.php @@ -137,6 +137,23 @@ public function call($call, $data = [], $options = []) return $client->SoapCall($function, $data, $options); }); } + /** + * A easy access call method + * + * @param string $call + * @param array $data + * + * @return mixed + */ + public function getLastCall($service_name) + { + + $service = $this->services[$service_name]; + + if (!is_null($service->getClient())) { + return $service->getClient()->__getLastRequest(); + } + } /** * Check if wrapper has service From cac6f8c011d3b99f3a87ca2c9145db61fbb0729a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Polles?= Date: Thu, 8 Apr 2021 11:08:39 -0300 Subject: [PATCH 2/2] changed the documentation from the method getLastCall --- src/Artisaninweb/SoapWrapper/SoapWrapper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Artisaninweb/SoapWrapper/SoapWrapper.php b/src/Artisaninweb/SoapWrapper/SoapWrapper.php index 7c1023d..8f8c5d7 100644 --- a/src/Artisaninweb/SoapWrapper/SoapWrapper.php +++ b/src/Artisaninweb/SoapWrapper/SoapWrapper.php @@ -137,11 +137,11 @@ public function call($call, $data = [], $options = []) return $client->SoapCall($function, $data, $options); }); } + /** - * A easy access call method + * Get last request from a service * - * @param string $call - * @param array $data + * @param string $service_name * * @return mixed */