Stellar PHP SDK API Documentation

PathsResponse extends IteratorIterator

Iterable collection of payment path responses

This class provides an iterable wrapper around a collection of PathResponse objects representing possible asset conversion routes. It extends IteratorIterator to enable efficient traversal of payment paths returned from Horizon API endpoints. The collection supports iteration, counting, array conversion, and dynamic addition of path records.

Used by PathsPageResponse to hold the paths contained in a single page of results. Each item represents a potential route for converting one asset to another through intermediate assets, including the required source amount and resulting destination amount.

Tags
see
PathResponse

For individual path details

see
PathsPageResponse

For paginated path results

Table of Contents

Methods

__construct()  : mixed
Constructs a new paths collection
add()  : void
Adds a path response to the collection
count()  : int
Gets the total number of paths in this collection
current()  : PathResponse
Gets the current path in the iteration
toArray()  : array<string|int, PathResponse>

Methods

count()

Gets the total number of paths in this collection

public count() : int
Return values
int

The count of payment paths


        
On this page

Search results