-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTransactionHistory.php
More file actions
45 lines (37 loc) · 1.03 KB
/
Copy pathTransactionHistory.php
File metadata and controls
45 lines (37 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace PHPBitLaunch\Types;
use PHPBitLaunch\Types\AbstractType;
use PHPBitLaunch\Types\Transaction;
class TransactionHistory extends AbstractType
{
/**
* @var Transaction[]
*/
public $history;
/**
* @var int
*/
public $total;
public function __construct($data = null)
{
if ($data) {
foreach ($data as $key => $value) {
switch ($key) {
// Check if property needs decoding as object
case 'history':
$history = [];
if ($value) {
foreach ($value as $k => $v) {
$history[$k] = new Transaction($v);
}
}
$this->__set($key, $history);
break;
default:
$this->__set($key, $value);
break;
}
}
}
}
}