1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace VasilDakov\Speedy\Model; |
6
|
|
|
|
7
|
|
|
use JMS\Serializer\Annotation as Serializer; |
8
|
|
|
use VasilDakov\Speedy\Property; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Class Complex. |
12
|
|
|
* |
13
|
|
|
* @Serializer\AccessType("public_method") |
14
|
|
|
* |
15
|
|
|
* @author Vasil Dakov <[email protected]> |
16
|
|
|
* @copyright 2009-2022 Neutrino.bg |
17
|
|
|
* |
18
|
|
|
* @version 1.0 |
19
|
|
|
* |
20
|
|
|
* @psalm-suppress MissingConstructor |
21
|
|
|
*/ |
22
|
|
|
class Complex |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* @Serializer\Type("int") |
26
|
|
|
*/ |
27
|
|
|
private int $id; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @Serializer\Type("int") |
31
|
|
|
*/ |
32
|
|
|
private int $siteId; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @Serializer\Type("string") |
36
|
|
|
*/ |
37
|
|
|
private string $type; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @Serializer\Type("string") |
41
|
|
|
*/ |
42
|
|
|
private string $typeEn; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @Serializer\Type("string") |
46
|
|
|
*/ |
47
|
|
|
private string $name; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @Serializer\Type("string") |
51
|
|
|
*/ |
52
|
|
|
private string $nameEn; |
53
|
|
|
|
54
|
|
|
public function getId(): int |
55
|
|
|
{ |
56
|
|
|
return $this->id; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function setId(int $id): void |
60
|
|
|
{ |
61
|
|
|
$this->id = $id; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function getSiteId(): int |
65
|
|
|
{ |
66
|
|
|
return $this->siteId; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function setSiteId(int $siteId): void |
70
|
|
|
{ |
71
|
|
|
$this->siteId = $siteId; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function getType(): string |
75
|
|
|
{ |
76
|
|
|
return $this->type; |
77
|
|
|
} |
78
|
|
|
|
79
|
1 |
|
public function setType(string $type): void |
80
|
|
|
{ |
81
|
1 |
|
$this->type = $type; |
82
|
|
|
} |
83
|
|
|
|
84
|
2 |
|
public function getTypeEn(): string |
85
|
|
|
{ |
86
|
2 |
|
return $this->typeEn; |
87
|
|
|
} |
88
|
|
|
|
89
|
1 |
|
public function setTypeEn(string $typeEn): void |
90
|
|
|
{ |
91
|
1 |
|
$this->typeEn = $typeEn; |
92
|
|
|
} |
93
|
|
|
|
94
|
2 |
|
public function getName(): string |
95
|
|
|
{ |
96
|
2 |
|
return $this->name; |
97
|
|
|
} |
98
|
|
|
|
99
|
1 |
|
public function setName(string $name): void |
100
|
|
|
{ |
101
|
1 |
|
$this->name = $name; |
102
|
|
|
} |
103
|
|
|
|
104
|
2 |
|
public function getNameEn(): string |
105
|
|
|
{ |
106
|
2 |
|
return $this->nameEn; |
107
|
|
|
} |
108
|
|
|
|
109
|
1 |
|
public function setNameEn(string $nameEn): void |
110
|
|
|
{ |
111
|
1 |
|
$this->nameEn = $nameEn; |
112
|
|
|
} |
113
|
|
|
|
114
|
2 |
|
/** |
115
|
|
|
* @return array |
116
|
2 |
|
*/ |
117
|
|
|
public function toArray(): array |
118
|
|
|
{ |
119
|
1 |
|
return [ |
120
|
|
|
Property::ID->value => $this->id, |
121
|
1 |
|
Property::SITE_ID->value => $this->siteId, |
122
|
|
|
Property::TYPE->value => $this->type, |
123
|
|
|
Property::TYPE_EN->value => $this->typeEn, |
124
|
2 |
|
Property::NAME->value => $this->name, |
125
|
|
|
Property::NAME_EN->value => $this->nameEn, |
126
|
2 |
|
]; |
127
|
|
|
} |
128
|
|
|
} |
129
|
|
|
|