Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoray committed Oct 30, 2023
1 parent b6c2b11 commit e934ce8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Resources/MandateCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@

class MandateCollection extends CursorCollection
{
public function getLazyCollectionName(): string
{
return LazyMandateCollection::class;
}

/**
* @return string
*/
Expand All @@ -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;
}
}

0 comments on commit e934ce8

Please sign in to comment.