1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the Zikula package. |
7
|
|
|
* |
8
|
|
|
* Copyright Zikula Foundation - https://ziku.la/ |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Zikula\ExtensionsModule\Entity; |
15
|
|
|
|
16
|
|
|
use Doctrine\ORM\Mapping as ORM; |
17
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
18
|
|
|
use Zikula\Bundle\CoreBundle\Doctrine\EntityAccess; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Extension Entity. |
22
|
|
|
* |
23
|
|
|
* @ORM\Entity(repositoryClass="Zikula\ExtensionsModule\Entity\Repository\ExtensionRepository") |
24
|
|
|
* @ORM\Table(name="extensions") |
25
|
|
|
*/ |
26
|
|
|
class ExtensionEntity extends EntityAccess |
27
|
|
|
{ |
28
|
|
|
/** |
29
|
|
|
* @ORM\Id |
30
|
|
|
* @ORM\GeneratedValue |
31
|
|
|
* @ORM\Column(type="integer") |
32
|
|
|
* @var int |
33
|
|
|
*/ |
34
|
|
|
private $id; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @ORM\Column(type="string", length=64) |
38
|
|
|
* @Assert\Length(min="0", max="64", allowEmptyString="false") |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
private $name; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @ORM\Column(name="`type`", type="integer", length=2) |
45
|
|
|
* @var int |
46
|
|
|
*/ |
47
|
|
|
private $type; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @ORM\Column(type="string", length=64) |
51
|
|
|
* @Assert\Length(min="0", max="64", allowEmptyString="false") |
52
|
|
|
* @var string |
53
|
|
|
*/ |
54
|
|
|
private $displayname; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @ORM\Column(type="string", length=64) |
58
|
|
|
* @Assert\Length(min="0", max="64", allowEmptyString="false") |
59
|
|
|
* @var string |
60
|
|
|
*/ |
61
|
|
|
private $url; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @ORM\Column(type="string", length=255) |
65
|
|
|
* @Assert\Length(min="0", max="255", allowEmptyString="true") |
66
|
|
|
* @var string |
67
|
|
|
*/ |
68
|
|
|
private $description; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @ORM\Column(type="string", length=10) |
72
|
|
|
* @Assert\Length(min="0", max="10", allowEmptyString="false") |
73
|
|
|
* @var string |
74
|
|
|
*/ |
75
|
|
|
private $version; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @ORM\Column(type="string", length=50) |
79
|
|
|
* @Assert\Length(min="0", max="50", allowEmptyString="true") |
80
|
|
|
* @var string |
81
|
|
|
*/ |
82
|
|
|
private $icon; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @ORM\Column(type="array") |
86
|
|
|
* @var array |
87
|
|
|
*/ |
88
|
|
|
private $capabilities = []; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @ORM\Column(type="integer", length=2) |
92
|
|
|
* @var int |
93
|
|
|
*/ |
94
|
|
|
private $state; |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @ORM\Column(type="array") |
98
|
|
|
* @var array |
99
|
|
|
*/ |
100
|
|
|
private $securityschema = []; |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @ORM\Column(type="string", length=64) |
104
|
|
|
* @Assert\Length(min="0", max="64", allowEmptyString="false") |
105
|
|
|
* @var string |
106
|
|
|
*/ |
107
|
|
|
private $coreCompatibility; |
108
|
|
|
|
109
|
|
|
public function __construct() |
110
|
|
|
{ |
111
|
|
|
$this->name = ''; |
112
|
|
|
$this->description = ''; |
113
|
|
|
$this->icon = ''; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
public function getId(): ?int |
117
|
|
|
{ |
118
|
|
|
return $this->id; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
public function setId(int $id): void |
122
|
|
|
{ |
123
|
|
|
$this->id = $id; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
public function getName(): string |
127
|
|
|
{ |
128
|
|
|
return $this->name; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
public function setName(string $name): void |
132
|
|
|
{ |
133
|
|
|
$this->name = $name; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
public function getType(): int |
137
|
|
|
{ |
138
|
|
|
return $this->type; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
public function setType(int $type): void |
142
|
|
|
{ |
143
|
|
|
$this->type = $type; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
public function getDisplayname(): string |
147
|
|
|
{ |
148
|
|
|
return $this->displayname; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
public function setDisplayname(string $displayname): void |
152
|
|
|
{ |
153
|
|
|
$this->displayname = $displayname; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
public function getUrl(): string |
157
|
|
|
{ |
158
|
|
|
return $this->url; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
public function setUrl(string $url): void |
162
|
|
|
{ |
163
|
|
|
$this->url = $url; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
public function getDescription(): string |
167
|
|
|
{ |
168
|
|
|
return $this->description; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
public function setDescription(string $description): void |
172
|
|
|
{ |
173
|
|
|
$this->description = $description; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
public function getIcon(): string |
177
|
|
|
{ |
178
|
|
|
return $this->icon ?? $this['capabilities']['admin']['icon'] ?? ''; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
public function setIcon(string $icon): void |
182
|
|
|
{ |
183
|
|
|
$this->icon = $icon ?? ''; |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
public function getVersion(): string |
187
|
|
|
{ |
188
|
|
|
return $this->version; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
public function setVersion(string $version): void |
192
|
|
|
{ |
193
|
|
|
$this->version = $version; |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
public function getCapabilities(): array |
197
|
|
|
{ |
198
|
|
|
return $this->capabilities; |
199
|
|
|
} |
200
|
|
|
|
201
|
|
|
public function setCapabilities(array $capabilities): void |
202
|
|
|
{ |
203
|
|
|
$this->capabilities = $capabilities; |
204
|
|
|
} |
205
|
|
|
|
206
|
|
|
public function getState(): int |
207
|
|
|
{ |
208
|
|
|
return $this->state; |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
public function setState(int $state): void |
212
|
|
|
{ |
213
|
|
|
$this->state = $state; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
public function getSecurityschema(): array |
217
|
|
|
{ |
218
|
|
|
return $this->securityschema; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
public function setSecurityschema(array $securityschema): void |
222
|
|
|
{ |
223
|
|
|
$this->securityschema = $securityschema; |
224
|
|
|
} |
225
|
|
|
|
226
|
|
|
public function getCoreCompatibility(): string |
227
|
|
|
{ |
228
|
|
|
return $this->coreCompatibility; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
public function setCoreCompatibility(string $coreCompatibility): void |
232
|
|
|
{ |
233
|
|
|
$this->coreCompatibility = $coreCompatibility; |
234
|
|
|
} |
235
|
|
|
} |
236
|
|
|
|