From cd9781d8c9ad0e4e89efcdc2dce043617f83fd35 Mon Sep 17 00:00:00 2001 From: Frederik Rommel Date: Thu, 29 Oct 2020 16:20:56 +0100 Subject: [PATCH 1/2] fix method annotation --- .../SubModel/Content/Customer/Addresses.php | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/Model/Request/SubModel/Content/Customer/Addresses.php b/src/Model/Request/SubModel/Content/Customer/Addresses.php index deee21a..1702ee5 100755 --- a/src/Model/Request/SubModel/Content/Customer/Addresses.php +++ b/src/Model/Request/SubModel/Content/Customer/Addresses.php @@ -17,8 +17,7 @@ use RatePAY\Model\Request\SubModel\Content\Customer\Addresses\Address; /** - * @method $this addAddress(Address $address) - * @method Address[] getAddresses() + * @method $this addAddress(Address $address) */ class Addresses extends AbstractModel { @@ -47,4 +46,26 @@ class Addresses extends AbstractModel 'multiple' => true, ], ]; + + /** + * @return Address[] + */ + public function getAddresses() + { + return $this->__get('Address'); + } + + /** + * @return Address + */ + public function getAddress($type) + { + foreach ($this->getAddresses() as $address) { + if (strtolower($address->getType()) === strtolower($type)) { + return $address; + } + } + + return null; + } } From 8cb4e04b1469b45e7f377610149c05b4249070bb Mon Sep 17 00:00:00 2001 From: Frederik Rommel Date: Mon, 2 Nov 2020 14:48:52 +0100 Subject: [PATCH 2/2] fix method annotation --- .../Request/SubModel/Content/ShoppingBasket/Items.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Model/Request/SubModel/Content/ShoppingBasket/Items.php b/src/Model/Request/SubModel/Content/ShoppingBasket/Items.php index e7d7089..874777f 100755 --- a/src/Model/Request/SubModel/Content/ShoppingBasket/Items.php +++ b/src/Model/Request/SubModel/Content/ShoppingBasket/Items.php @@ -17,8 +17,7 @@ use RatePAY\Model\Request\SubModel\Content\ShoppingBasket\Items\Item; /** - * @method $this addItem(Item $item) - * @method Item[] getItems() + * @method $this addItem(Item $item) */ class Items extends AbstractModel { @@ -76,4 +75,9 @@ protected function rule() return true; } + + public function getItems() + { + return $this->__get('Item'); + } }