OffersResponse
extends IteratorIterator
in package
Iterable collection of offer responses
This class provides an iterable wrapper around a collection of OfferResponse objects representing DEX offers. It extends IteratorIterator to enable efficient traversal of offers returned from Horizon API endpoints. The collection supports iteration, counting, array conversion, and dynamic addition of offer records.
Used by OffersPageResponse to hold the offers contained in a single page of results. Each item in the collection represents an individual standing order on the Stellar distributed exchange with its price, amounts, and asset details.
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs a new offers collection
- add() : void
- Adds an offer response to the collection
- count() : int
- Gets the total number of offers in this collection
- current() : OfferResponse
- Gets the current offer in the iteration
- toArray() : array<string|int, OfferResponse>
Methods
__construct()
Constructs a new offers collection
public
__construct(OfferResponse ...$offers) : mixed
Parameters
- $offers : OfferResponse
-
Variable number of offer responses
add()
Adds an offer response to the collection
public
add(OfferResponse $offer) : void
Parameters
- $offer : OfferResponse
-
The offer response to add
count()
Gets the total number of offers in this collection
public
count() : int
Return values
int —The count of offers
current()
Gets the current offer in the iteration
public
current() : OfferResponse
Return values
OfferResponse —The current offer response
toArray()
public
toArray() : array<string|int, OfferResponse>