# 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

```php
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

```php
public function addBalance(BalanceInterface $balance): self
```

Add a single BalanceInterface object to an existing BalanceCollection.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `BalanceInterface` | `$balance` | A single BalanceInterface object |


**Returns** `$this`

### factoryFromArray

```php
public static function factoryFromArray(array $balances): self
```

Make a BalanceCollection object from an array of data.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `array` | `$balances` | An array of balances made from a BalanceInterface object. |


**Returns** `static`