AccountsResponse
extends IteratorIterator
in package
Represents a collection of accounts
This iterable collection holds multiple account responses returned by list endpoints. The collection is typically part of AccountsPageResponse for paginated results and provides iterator functionality to traverse all account entries.
Tags
Table of Contents
Methods
- __construct() : mixed
- Creates a new collection of accounts
- add() : mixed
- Adds an account entry to the collection
- count() : int
- Gets the number of account entries in the collection
- current() : AccountResponse
- Gets the current account in the iteration
- toArray() : array<string|int, AccountResponse>
- Converts the collection to an array
Methods
__construct()
Creates a new collection of accounts
public
__construct(AccountResponse ...$accounts) : mixed
Parameters
- $accounts : AccountResponse
-
Variable number of account entries
add()
Adds an account entry to the collection
public
add(AccountResponse $account) : mixed
Parameters
- $account : AccountResponse
-
The account entry to add
count()
Gets the number of account entries in the collection
public
count() : int
Return values
int —The count of account entries
current()
Gets the current account in the iteration
public
current() : AccountResponse
Return values
AccountResponse —The current account entry
toArray()
Converts the collection to an array
public
toArray() : array<string|int, AccountResponse>
Return values
array<string|int, AccountResponse> —Array of account entries