1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace SlayerBirden\DataFlowServer\Db\Entities; |
5
|
|
|
|
6
|
|
|
use Doctrine\ORM\Mapping as ORM; |
7
|
|
|
use SlayerBirden\DataFlowServer\Domain\Entities\ClaimedResourceInterface; |
8
|
|
|
use SlayerBirden\DataFlowServer\Domain\Entities\User; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @ORM\Entity |
12
|
|
|
* @ORM\Table(name="configuration") |
13
|
|
|
**/ |
14
|
|
|
class DbConfiguration implements ClaimedResourceInterface |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @ORM\Id |
18
|
|
|
* @ORM\Column(type="integer") |
19
|
|
|
* @ORM\GeneratedValue |
20
|
|
|
* @var integer|null |
21
|
|
|
**/ |
22
|
|
|
private $id; |
23
|
|
|
/** |
24
|
|
|
* @ORM\Column(type="string") |
25
|
|
|
* @var string |
26
|
|
|
**/ |
27
|
|
|
private $title; |
28
|
|
|
/** |
29
|
|
|
* @ORM\ManyToOne(targetEntity="\SlayerBirden\DataFlowServer\Domain\Entities\User") |
30
|
|
|
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE") |
31
|
|
|
* @var User |
32
|
|
|
**/ |
33
|
|
|
private $owner; |
34
|
|
|
/** |
35
|
|
|
* @ORM\Column(type="string", nullable=true) |
36
|
|
|
* @var string|null |
37
|
|
|
**/ |
38
|
|
|
private $dbname; |
39
|
|
|
/** |
40
|
|
|
* @ORM\Column(type="string", nullable=true) |
41
|
|
|
* @var string|null |
42
|
|
|
**/ |
43
|
|
|
private $user; |
44
|
|
|
/** |
45
|
|
|
* @ORM\Column(type="string", nullable=true) |
46
|
|
|
* @var string|null |
47
|
|
|
**/ |
48
|
|
|
private $password; |
49
|
|
|
/** |
50
|
|
|
* @ORM\Column(type="string", nullable=true) |
51
|
|
|
* @var string|null |
52
|
|
|
**/ |
53
|
|
|
private $host; |
54
|
|
|
/** |
55
|
|
|
* @ORM\Column(type="string", nullable=true) |
56
|
|
|
* @var string|null |
57
|
|
|
**/ |
58
|
|
|
private $driver; |
59
|
|
|
/** |
60
|
|
|
* @ORM\Column(type="integer", nullable=true) |
61
|
|
|
* @var integer|null |
62
|
|
|
**/ |
63
|
|
|
private $port; |
64
|
|
|
/** |
65
|
|
|
* @ORM\Column(type="string", nullable=true) |
66
|
|
|
* @var string|null |
67
|
|
|
**/ |
68
|
|
|
private $url; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return int|null |
72
|
|
|
*/ |
73
|
22 |
|
public function getId(): ?int |
74
|
|
|
{ |
75
|
22 |
|
return $this->id; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return string |
80
|
|
|
*/ |
81
|
22 |
|
public function getTitle(): string |
82
|
|
|
{ |
83
|
22 |
|
return $this->title; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @param string $title |
88
|
|
|
*/ |
89
|
14 |
|
public function setTitle(string $title): void |
90
|
|
|
{ |
91
|
14 |
|
$this->title = $title; |
92
|
14 |
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return User |
96
|
|
|
*/ |
97
|
24 |
|
public function getOwner(): User |
98
|
|
|
{ |
99
|
24 |
|
return $this->owner; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @param User $owner |
104
|
|
|
*/ |
105
|
14 |
|
public function setOwner(User $owner): void |
106
|
|
|
{ |
107
|
14 |
|
$this->owner = $owner; |
108
|
14 |
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @return string|null |
112
|
|
|
*/ |
113
|
26 |
|
public function getDbname(): ?string |
114
|
|
|
{ |
115
|
26 |
|
return $this->dbname; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @param string $dbname |
120
|
|
|
*/ |
121
|
6 |
|
public function setDbname(?string $dbname): void |
122
|
|
|
{ |
123
|
6 |
|
$this->dbname = $dbname; |
124
|
6 |
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @return string|null |
128
|
|
|
*/ |
129
|
22 |
|
public function getUser(): ?string |
130
|
|
|
{ |
131
|
22 |
|
return $this->user; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @param string $user |
136
|
|
|
*/ |
137
|
2 |
|
public function setUser(?string $user): void |
138
|
|
|
{ |
139
|
2 |
|
$this->user = $user; |
140
|
2 |
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @return string|null |
144
|
|
|
*/ |
145
|
22 |
|
public function getPassword(): ?string |
146
|
|
|
{ |
147
|
22 |
|
return $this->password; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* @param string $password |
152
|
|
|
*/ |
153
|
2 |
|
public function setPassword(?string $password): void |
154
|
|
|
{ |
155
|
2 |
|
$this->password = $password; |
156
|
2 |
|
} |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* @return string|null |
160
|
|
|
*/ |
161
|
22 |
|
public function getHost(): ?string |
162
|
|
|
{ |
163
|
22 |
|
return $this->host; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
/** |
167
|
|
|
* @param string $host |
168
|
|
|
*/ |
169
|
2 |
|
public function setHost(?string $host): void |
170
|
|
|
{ |
171
|
2 |
|
$this->host = $host; |
172
|
2 |
|
} |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* @return string|null |
176
|
|
|
*/ |
177
|
26 |
|
public function getDriver(): ?string |
178
|
|
|
{ |
179
|
26 |
|
return $this->driver; |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* @param string $driver |
184
|
|
|
*/ |
185
|
2 |
|
public function setDriver(?string $driver): void |
186
|
|
|
{ |
187
|
2 |
|
$this->driver = $driver; |
188
|
2 |
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* @return int|null |
192
|
|
|
*/ |
193
|
22 |
|
public function getPort(): ?int |
194
|
|
|
{ |
195
|
22 |
|
return $this->port; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* @param int $port |
200
|
|
|
*/ |
201
|
2 |
|
public function setPort(?int $port): void |
202
|
|
|
{ |
203
|
2 |
|
$this->port = $port; |
204
|
2 |
|
} |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* @return string|null |
208
|
|
|
*/ |
209
|
26 |
|
public function getUrl(): ?string |
210
|
|
|
{ |
211
|
26 |
|
return $this->url; |
212
|
|
|
} |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* @param string $url |
216
|
|
|
*/ |
217
|
8 |
|
public function setUrl(?string $url): void |
218
|
|
|
{ |
219
|
8 |
|
$this->url = $url; |
220
|
8 |
|
} |
221
|
|
|
} |
222
|
|
|
|