From e934ce8c08758ed9517ee4f8b4ca1e0fc61af7cd Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Mon, 30 Oct 2023 15:27:53 +0100 Subject: [PATCH] wip --- src/Resources/MandateCollection.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Resources/MandateCollection.php b/src/Resources/MandateCollection.php index 235fe3ff..23d39d16 100644 --- a/src/Resources/MandateCollection.php +++ b/src/Resources/MandateCollection.php @@ -4,11 +4,6 @@ class MandateCollection extends CursorCollection { - public function getLazyCollectionName(): string - { - return LazyMandateCollection::class; - } - /** * @return string */ @@ -31,6 +26,15 @@ protected function createResourceObject() */ public function whereStatus($status) { - return $this->filter(fn (Mandate $mandate) => $mandate->status === $status); + $collection = new self($this->client, 0, $this->_links); + + foreach ($this as $item) { + if ($item->status === $status) { + $collection[] = $item; + $collection->count++; + } + } + + return $collection; } }