-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathExportLayoutConfiguration.php
More file actions
executable file
·175 lines (150 loc) · 3.58 KB
/
Copy pathExportLayoutConfiguration.php
File metadata and controls
executable file
·175 lines (150 loc) · 3.58 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php
// The content of this file was automatically generated
namespace ProcessOut;
use ProcessOut\ProcessOut;
use ProcessOut\Networking\Request;
class ExportLayoutConfiguration implements \JsonSerializable
{
/**
* ProcessOut's client
* @var ProcessOut\ProcessOut
*/
protected $client;
/**
* Columns that will be exported.
* @var list
*/
protected $columns;
/**
* Time related configurations.
* @var object
*/
protected $time;
/**
* Amount related configurations.
* @var object
*/
protected $amount;
/**
* ExportLayoutConfiguration constructor
* @param ProcessOut\ProcessOut $client
* @param array|null $prefill
*/
public function __construct(ProcessOut $client, $prefill = array())
{
$this->client = $client;
$this->fillWithData($prefill);
}
/**
* Get Columns
* Columns that will be exported.
* @return array
*/
public function getColumns()
{
return $this->columns;
}
/**
* Set Columns
* Columns that will be exported.
* @param array $value
* @return $this
*/
public function setColumns($value)
{
if (count($value) > 0 && is_object($value[0]))
$this->columns = $value;
else
{
$a = array();
foreach ($value as $v)
{
$obj = new ExportLayoutConfigurationColumn($this->client);
$obj->fillWithData($v);
$a[] = $obj;
}
$this->columns = $a;
}
return $this;
}
/**
* Get Time
* Time related configurations.
* @return object
*/
public function getTime()
{
return $this->time;
}
/**
* Set Time
* Time related configurations.
* @param object $value
* @return $this
*/
public function setTime($value)
{
if (is_object($value))
$this->time = $value;
else
{
$obj = new ExportLayoutConfigurationTime($this->client);
$obj->fillWithData($value);
$this->time = $obj;
}
return $this;
}
/**
* Get Amount
* Amount related configurations.
* @return object
*/
public function getAmount()
{
return $this->amount;
}
/**
* Set Amount
* Amount related configurations.
* @param object $value
* @return $this
*/
public function setAmount($value)
{
if (is_object($value))
$this->amount = $value;
else
{
$obj = new ExportLayoutConfigurationAmount($this->client);
$obj->fillWithData($value);
$this->amount = $obj;
}
return $this;
}
/**
* Fills the current object with the new values pulled from the data
* @param array $data
* @return ExportLayoutConfiguration
*/
public function fillWithData($data)
{
if(! empty($data['columns']))
$this->setColumns($data['columns']);
if(! empty($data['time']))
$this->setTime($data['time']);
if(! empty($data['amount']))
$this->setAmount($data['amount']);
return $this;
}
/**
* Implements the JsonSerializable interface
* @return array
*/
public function jsonSerialize(): array {
return array(
"columns" => $this->getColumns(),
"time" => $this->getTime(),
"amount" => $this->getAmount(),
);
}
}