LiquidityPoolsResponse
extends IteratorIterator
in package
Iterable collection of liquidity pool responses
This class provides an iterable wrapper around a collection of LiquidityPoolResponse objects. It extends IteratorIterator to enable efficient traversal of liquidity pools returned from Horizon API endpoints. The collection supports iteration, counting, array conversion, and dynamic addition of pool records.
Used by LiquidityPoolsPageResponse to hold the pools contained in a single page of results. Each item in the collection represents an individual liquidity pool with its reserves, shares, and metadata.
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs a new liquidity pools collection
- add() : void
- Adds a liquidity pool response to the collection
- count() : int
- Gets the total number of liquidity pools in this collection
- current() : LiquidityPoolResponse
- Gets the current liquidity pool in the iteration
- toArray() : array<string|int, LiquidityPoolResponse>
Methods
__construct()
Constructs a new liquidity pools collection
public
__construct(LiquidityPoolResponse ...$responses) : mixed
Parameters
- $responses : LiquidityPoolResponse
-
Variable number of liquidity pool responses
add()
Adds a liquidity pool response to the collection
public
add(LiquidityPoolResponse $response) : void
Parameters
- $response : LiquidityPoolResponse
-
The pool response to add
count()
Gets the total number of liquidity pools in this collection
public
count() : int
Return values
int —The count of pools
current()
Gets the current liquidity pool in the iteration
public
current() : LiquidityPoolResponse
Return values
LiquidityPoolResponse —The current pool response
toArray()
public
toArray() : array<string|int, LiquidityPoolResponse>