Stellar PHP SDK API Documentation

TransactionsResponse extends IteratorIterator

Represents an iterable collection of transaction responses

This collection holds multiple TransactionResponse objects and provides convenient iteration, counting, and array conversion capabilities. It extends IteratorIterator to allow direct use in foreach loops and other iteration contexts.

Typically populated within a TransactionsPageResponse when querying transaction lists from Horizon. The collection can be dynamically expanded by adding new transaction responses.

Usage patterns:

  • Iterate: foreach ($transactions as $transaction) { ... }
  • Count: $transactions->count()
  • Convert: $array = $transactions->toArray()
  • Add: $transactions->add($newTransaction)
Tags
see
TransactionsPageResponse

For paginated transaction results

see
TransactionResponse

For individual transaction details

since
1.0.0

Table of Contents

Methods

__construct()  : mixed
Creates a new transactions collection
add()  : void
Adds a transaction to the collection
count()  : int
Gets the number of transactions in the collection
current()  : TransactionResponse
Gets the current transaction in the iteration
toArray()  : array<string|int, TransactionResponse>
Converts the transaction collection to an array

Methods

count()

Gets the number of transactions in the collection

public count() : int
Return values
int

The transaction count


        
On this page

Search results