From 8a280e429cec9f920efed49f96c7b8c15c856fba Mon Sep 17 00:00:00 2001 From: Casper Bakker Date: Wed, 20 Sep 2023 10:37:44 +0200 Subject: [PATCH] Support ParcelStatus findAll's --- src/Picqer/Carriers/SendCloud/Query/FindAll.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Picqer/Carriers/SendCloud/Query/FindAll.php b/src/Picqer/Carriers/SendCloud/Query/FindAll.php index 84a292d..2b035a2 100644 --- a/src/Picqer/Carriers/SendCloud/Query/FindAll.php +++ b/src/Picqer/Carriers/SendCloud/Query/FindAll.php @@ -25,11 +25,16 @@ public function collectionFromResult($result) { $collection = []; - foreach ($result[$this->namespaces['plural']] as $r) { - $collection[] = new self($this->connection(), $r); + $resultsContainer = $result; + if (isset($result[$this->namespaces['plural']])) { + $resultsContainer = $result[$this->namespaces['plural']]; + } + + foreach ($resultsContainer as $item) { + $collection[] = new self($this->connection(), $item); } return $collection; } -} \ No newline at end of file +}