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; } }