AssetsResponse
extends IteratorIterator
in package
Iterable collection of asset responses
Provides iterator functionality for traversing multiple AssetResponse objects. Supports adding assets, counting, and converting to array.
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs an assets collection
- add() : void
- Adds an asset to the collection
- count() : int
- Gets the total number of assets in the collection
- current() : AssetResponse
- Gets the current asset in the iteration
- toArray() : array<string|int, AssetResponse>
- Converts the collection to an array
Methods
__construct()
Constructs an assets collection
public
__construct(AssetResponse ...$assets) : mixed
Parameters
- $assets : AssetResponse
-
Variable number of asset responses
add()
Adds an asset to the collection
public
add(AssetResponse $asset) : void
Parameters
- $asset : AssetResponse
-
The asset to add
count()
Gets the total number of assets in the collection
public
count() : int
Return values
int —The count of assets
current()
Gets the current asset in the iteration
public
current() : AssetResponse
Return values
AssetResponse —The current asset
toArray()
Converts the collection to an array
public
toArray() : array<string|int, AssetResponse>
Return values
array<string|int, AssetResponse> —Array of asset responses