1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is auto-generated. |
5
|
|
|
*/ |
6
|
|
|
|
7
|
|
|
declare(strict_types=1); |
8
|
|
|
|
9
|
|
|
namespace Transfer; |
10
|
|
|
|
11
|
|
|
use DateTimeInterface; |
12
|
|
|
use Micro\Library\DTO\Object\AbstractDto; |
13
|
|
|
use Micro\Library\DTO\Object\Collection; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @deprecated Please, use gSON |
17
|
|
|
* Example class description |
18
|
|
|
*/ |
19
|
|
|
final class UserTransfer extends AbstractDto |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* Username |
23
|
|
|
* @deprecated Deprecation message |
24
|
|
|
*/ |
25
|
|
|
protected string|int|null $username = null; |
26
|
|
|
protected iterable|null $books = null; |
27
|
|
|
protected string|int $first_name; |
28
|
|
|
protected DateTimeInterface|null $updatedAt = null; |
29
|
|
|
protected AbstractDto|null $someclass = null; |
30
|
|
|
protected mixed $testMixed = null; |
31
|
|
|
|
32
|
|
|
public function getUsername(): string|int|null |
33
|
|
|
{ |
34
|
|
|
return $this->username; |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
public function getBooks(): iterable|null |
38
|
|
|
{ |
39
|
|
|
return $this->books; |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function getFirstName(): string|int |
43
|
|
|
{ |
44
|
|
|
return $this->first_name; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
public function getUpdatedAt(): DateTimeInterface|null |
48
|
|
|
{ |
49
|
|
|
return $this->updatedAt; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function getSomeclass(): AbstractDto|null |
53
|
|
|
{ |
54
|
|
|
return $this->someclass; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public function getTestMixed(): mixed |
58
|
|
|
{ |
59
|
|
|
return $this->testMixed; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function setUsername(string|int|null $username): self |
63
|
|
|
{ |
64
|
|
|
$this->username = $username; |
65
|
|
|
|
66
|
|
|
return $this; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function setBooks(iterable|null $books): self |
70
|
|
|
{ |
71
|
|
|
if(!$books) { |
72
|
|
|
$this->books = null; |
73
|
|
|
|
74
|
|
|
return $this; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
if(!$this->books) { |
78
|
|
|
$this->books = new Collection(); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
foreach($books as $item) { |
82
|
|
|
$this->books->add($item); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
return $this; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
public function setFirstName(string|int $first_name): self |
89
|
|
|
{ |
90
|
|
|
$this->first_name = $first_name; |
91
|
|
|
|
92
|
|
|
return $this; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
public function setUpdatedAt(DateTimeInterface|null $updatedAt): self |
96
|
|
|
{ |
97
|
|
|
$this->updatedAt = $updatedAt; |
98
|
|
|
|
99
|
|
|
return $this; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
public function setSomeclass(AbstractDto|null $someclass): self |
103
|
|
|
{ |
104
|
|
|
$this->someclass = $someclass; |
105
|
|
|
|
106
|
|
|
return $this; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
public function setTestMixed(mixed $testMixed): self |
110
|
|
|
{ |
111
|
|
|
$this->testMixed = $testMixed; |
112
|
|
|
|
113
|
|
|
return $this; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
protected static function attributesMetadata(): array |
117
|
|
|
{ |
118
|
|
|
return array ( |
119
|
|
|
'username' => |
120
|
|
|
array ( |
121
|
|
|
'type' => |
122
|
|
|
array ( |
123
|
|
|
0 => 'string', |
124
|
|
|
1 => 'int', |
125
|
|
|
2 => 'null', |
126
|
|
|
), |
127
|
|
|
'required' => false, |
128
|
|
|
'actionName' => 'username', |
129
|
|
|
), |
130
|
|
|
'books' => |
131
|
|
|
array ( |
132
|
|
|
'type' => |
133
|
|
|
array ( |
134
|
|
|
0 => 'iterable', |
135
|
|
|
1 => 'null', |
136
|
|
|
), |
137
|
|
|
'required' => false, |
138
|
|
|
'actionName' => 'books', |
139
|
|
|
), |
140
|
|
|
'first_name' => |
141
|
|
|
array ( |
142
|
|
|
'type' => |
143
|
|
|
array ( |
144
|
|
|
0 => 'string', |
145
|
|
|
1 => 'int', |
146
|
|
|
), |
147
|
|
|
'required' => true, |
148
|
|
|
'actionName' => 'firstName', |
149
|
|
|
), |
150
|
|
|
'updatedAt' => |
151
|
|
|
array ( |
152
|
|
|
'type' => |
153
|
|
|
array ( |
154
|
|
|
0 => 'DateTimeInterface', |
155
|
|
|
1 => 'null', |
156
|
|
|
), |
157
|
|
|
'required' => false, |
158
|
|
|
'actionName' => 'updatedAt', |
159
|
|
|
), |
160
|
|
|
'someclass' => |
161
|
|
|
array ( |
162
|
|
|
'type' => |
163
|
|
|
array ( |
164
|
|
|
0 => 'Micro\\Library\\DTO\\Object\\AbstractDto', |
165
|
|
|
1 => 'null', |
166
|
|
|
), |
167
|
|
|
'required' => false, |
168
|
|
|
'actionName' => 'someclass', |
169
|
|
|
), |
170
|
|
|
'testMixed' => |
171
|
|
|
array ( |
172
|
|
|
'type' => |
173
|
|
|
array ( |
174
|
|
|
0 => 'mixed', |
175
|
|
|
), |
176
|
|
|
'required' => false, |
177
|
|
|
'actionName' => 'testMixed', |
178
|
|
|
), |
179
|
|
|
); |
180
|
|
|
} |
181
|
|
|
} |
182
|
|
|
|