|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
|
6
|
|
|
|
|
7
|
|
|
namespace Chamilo\CoreBundle\Entity; |
|
8
|
|
|
|
|
9
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
10
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Platform settings. |
|
14
|
|
|
*/ |
|
15
|
|
|
#[ORM\Table(name: 'settings', options: ['row_format' => 'DYNAMIC'])] |
|
16
|
|
|
#[ORM\Index(columns: ['access_url'], name: 'access_url')] |
|
17
|
|
|
#[ORM\UniqueConstraint(name: 'unique_setting', columns: ['variable', 'subkey', 'access_url'])] |
|
18
|
|
|
#[ORM\Entity] |
|
19
|
|
|
class SettingsCurrent |
|
20
|
|
|
{ |
|
21
|
|
|
#[ORM\Column(name: 'id', type: 'integer')] |
|
22
|
|
|
#[ORM\Id] |
|
23
|
|
|
#[ORM\GeneratedValue] |
|
24
|
|
|
protected ?int $id = null; |
|
25
|
|
|
|
|
26
|
|
|
#[ORM\ManyToOne(targetEntity: AccessUrl::class, cascade: ['persist'], inversedBy: 'settings')] |
|
27
|
|
|
#[ORM\JoinColumn(name: 'access_url', referencedColumnName: 'id')] |
|
28
|
|
|
protected AccessUrl $url; |
|
29
|
|
|
|
|
30
|
|
|
#[Assert\NotBlank] |
|
31
|
|
|
#[ORM\Column(name: 'variable', type: 'string', length: 190, nullable: false)] |
|
32
|
|
|
protected string $variable; |
|
33
|
|
|
|
|
34
|
|
|
#[ORM\Column(name: 'subkey', type: 'string', length: 190, nullable: true)] |
|
35
|
|
|
protected ?string $subkey = null; |
|
36
|
|
|
|
|
37
|
|
|
#[ORM\Column(name: 'type', type: 'string', length: 255, nullable: true)] |
|
38
|
|
|
protected ?string $type = null; |
|
39
|
|
|
|
|
40
|
|
|
#[ORM\Column(name: 'category', type: 'string', length: 255, nullable: true)] |
|
41
|
|
|
protected ?string $category = null; |
|
42
|
|
|
|
|
43
|
|
|
#[ORM\Column(name: 'selected_value', type: 'text', nullable: true)] |
|
44
|
|
|
protected ?string $selectedValue = null; |
|
45
|
|
|
|
|
46
|
|
|
#[Assert\NotBlank] |
|
47
|
|
|
#[ORM\Column(name: 'title', type: 'text', nullable: false)] |
|
48
|
|
|
protected string $title; |
|
49
|
|
|
|
|
50
|
|
|
#[ORM\Column(name: 'comment', type: 'text', nullable: true)] |
|
51
|
|
|
protected ?string $comment = null; |
|
52
|
|
|
|
|
53
|
|
|
#[ORM\Column(name: 'scope', type: 'string', length: 50, nullable: true)] |
|
54
|
|
|
protected ?string $scope = null; |
|
55
|
|
|
|
|
56
|
|
|
#[ORM\Column(name: 'subkeytext', type: 'string', length: 255, nullable: true)] |
|
57
|
|
|
protected ?string $subkeytext = null; |
|
58
|
|
|
|
|
59
|
|
|
#[Assert\NotBlank] |
|
60
|
|
|
#[ORM\Column(name: 'access_url_changeable', type: 'integer', nullable: false)] |
|
61
|
|
|
protected int $accessUrlChangeable; |
|
62
|
|
|
|
|
63
|
|
|
#[Assert\NotBlank] |
|
64
|
|
|
#[ORM\Column(name: 'access_url_locked', type: 'integer', nullable: false, options: ['default' => 0])] |
|
65
|
|
|
protected int $accessUrlLocked = 0; |
|
66
|
|
|
|
|
67
|
|
|
#[ORM\ManyToOne(targetEntity: SettingsValueTemplate::class)] |
|
68
|
|
|
#[ORM\JoinColumn(name: 'value_template_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')] |
|
69
|
|
|
protected ?SettingsValueTemplate $valueTemplate = null; |
|
70
|
|
|
|
|
71
|
|
|
public function __construct() |
|
72
|
|
|
{ |
|
73
|
|
|
$this->accessUrlLocked = 0; |
|
74
|
|
|
$this->scope = ''; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
public function getVariable(): string |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->variable; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function setVariable(string $variable): self |
|
83
|
|
|
{ |
|
84
|
|
|
$this->variable = $variable; |
|
85
|
|
|
|
|
86
|
|
|
return $this; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
public function getSubkey(): ?string |
|
90
|
|
|
{ |
|
91
|
|
|
return $this->subkey; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
public function setSubkey(string $subkey): self |
|
95
|
|
|
{ |
|
96
|
|
|
$this->subkey = $subkey; |
|
97
|
|
|
|
|
98
|
|
|
return $this; |
|
99
|
|
|
} |
|
100
|
|
|
|
|
101
|
|
|
public function getType(): ?string |
|
102
|
|
|
{ |
|
103
|
|
|
return $this->type; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
public function setType(string $type): self |
|
107
|
|
|
{ |
|
108
|
|
|
$this->type = $type; |
|
109
|
|
|
|
|
110
|
|
|
return $this; |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
public function getCategory(): ?string |
|
114
|
|
|
{ |
|
115
|
|
|
return $this->category; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
public function setCategory(?string $category): self |
|
119
|
|
|
{ |
|
120
|
|
|
$this->category = $category; |
|
121
|
|
|
|
|
122
|
|
|
return $this; |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
public function getSelectedValue(): ?string |
|
126
|
|
|
{ |
|
127
|
|
|
return $this->selectedValue; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
public function setSelectedValue(float|int|string|null $selectedValue): self |
|
131
|
|
|
{ |
|
132
|
|
|
$this->selectedValue = $selectedValue; |
|
133
|
|
|
|
|
134
|
|
|
return $this; |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
public function getTitle(): string |
|
138
|
|
|
{ |
|
139
|
|
|
return $this->title; |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
public function setTitle(string $title): self |
|
143
|
|
|
{ |
|
144
|
|
|
$this->title = $title; |
|
145
|
|
|
|
|
146
|
|
|
return $this; |
|
147
|
|
|
} |
|
148
|
|
|
|
|
149
|
|
|
public function getComment(): ?string |
|
150
|
|
|
{ |
|
151
|
|
|
return $this->comment; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
public function setComment(string $comment): self |
|
155
|
|
|
{ |
|
156
|
|
|
$this->comment = $comment; |
|
157
|
|
|
|
|
158
|
|
|
return $this; |
|
159
|
|
|
} |
|
160
|
|
|
|
|
161
|
|
|
public function getScope(): ?string |
|
162
|
|
|
{ |
|
163
|
|
|
return $this->scope; |
|
164
|
|
|
} |
|
165
|
|
|
|
|
166
|
|
|
public function setScope(string $scope): self |
|
167
|
|
|
{ |
|
168
|
|
|
$this->scope = $scope; |
|
169
|
|
|
|
|
170
|
|
|
return $this; |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
public function getSubkeytext(): ?string |
|
174
|
|
|
{ |
|
175
|
|
|
return $this->subkeytext; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
public function setSubkeytext(string $subkeytext): self |
|
179
|
|
|
{ |
|
180
|
|
|
$this->subkeytext = $subkeytext; |
|
181
|
|
|
|
|
182
|
|
|
return $this; |
|
183
|
|
|
} |
|
184
|
|
|
|
|
185
|
|
|
public function getAccessUrlChangeable(): int |
|
186
|
|
|
{ |
|
187
|
|
|
return $this->accessUrlChangeable; |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
public function setAccessUrlChangeable(int $accessUrlChangeable): self |
|
191
|
|
|
{ |
|
192
|
|
|
$this->accessUrlChangeable = $accessUrlChangeable; |
|
193
|
|
|
|
|
194
|
|
|
return $this; |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
public function getAccessUrlLocked(): int |
|
198
|
|
|
{ |
|
199
|
|
|
return $this->accessUrlLocked; |
|
200
|
|
|
} |
|
201
|
|
|
|
|
202
|
|
|
public function setAccessUrlLocked(int $accessUrlLocked): self |
|
203
|
|
|
{ |
|
204
|
|
|
$this->accessUrlLocked = $accessUrlLocked; |
|
205
|
|
|
|
|
206
|
|
|
return $this; |
|
207
|
|
|
} |
|
208
|
|
|
|
|
209
|
|
|
public function getId(): ?int |
|
210
|
|
|
{ |
|
211
|
|
|
return $this->id; |
|
212
|
|
|
} |
|
213
|
|
|
|
|
214
|
|
|
public function getUrl(): AccessUrl |
|
215
|
|
|
{ |
|
216
|
|
|
return $this->url; |
|
217
|
|
|
} |
|
218
|
|
|
|
|
219
|
|
|
public function setUrl(AccessUrl $url): self |
|
220
|
|
|
{ |
|
221
|
|
|
$this->url = $url; |
|
222
|
|
|
|
|
223
|
|
|
return $this; |
|
224
|
|
|
} |
|
225
|
|
|
|
|
226
|
|
|
public function getValueTemplate(): ?SettingsValueTemplate |
|
227
|
|
|
{ |
|
228
|
|
|
return $this->valueTemplate; |
|
229
|
|
|
} |
|
230
|
|
|
|
|
231
|
|
|
public function setValueTemplate(?SettingsValueTemplate $template): self |
|
232
|
|
|
{ |
|
233
|
|
|
$this->valueTemplate = $template; |
|
234
|
|
|
|
|
235
|
|
|
return $this; |
|
236
|
|
|
} |
|
237
|
|
|
} |
|
238
|
|
|
|