Skip to content
Last updated

WHMCS\Module\Gateway\BalanceCollection

Class · extends Collection

The BalanceCollection object is used to return data through a gateway module to display balance information on the Transactions List page in the WHMCS Admin area.

Methods

factoryFromItems

public static function factoryFromItems(BalanceInterface ...$balanceArray): self

The recommended method for creating a BalanceCollection object that should be returned via the custom gateway module.

Returns static

addBalance

public function addBalance(BalanceInterface $balance): self

Add a single BalanceInterface object to an existing BalanceCollection.

Parameters

TypeNameDescription
BalanceInterface$balanceA single BalanceInterface object

Returns $this

factoryFromArray

public static function factoryFromArray(array $balances): self

Make a BalanceCollection object from an array of data.

Parameters

TypeNameDescription
array$balancesAn array of balances made from a BalanceInterface object.

Returns static