1 | <?php |
||
50 | class Vhost |
||
51 | { |
||
52 | /** |
||
53 | * Virtual host ID |
||
54 | * |
||
55 | * @var integer |
||
56 | * @Id @Column(type="integer") |
||
57 | * @GeneratedValue |
||
58 | */ |
||
59 | protected $id; |
||
60 | /** |
||
61 | * Active |
||
62 | * |
||
63 | * @var boolean |
||
64 | * @Column(type="boolean") |
||
65 | */ |
||
66 | protected $active; |
||
67 | /** |
||
68 | * Account this domain is belonging to |
||
69 | * |
||
70 | * @var Account |
||
71 | * @ManyToOne(targetEntity="Tollwerk\Admin\Infrastructure\Model\Account", inversedBy="vhosts") |
||
72 | * @JoinColumn(name="account_id", referencedColumnName="id", onDelete="CASCADE") |
||
73 | */ |
||
74 | protected $account; |
||
75 | /** |
||
76 | * Virtual host type |
||
77 | * |
||
78 | * @var string |
||
79 | * @Column(type="enumvhosttype") |
||
80 | */ |
||
81 | protected $type; |
||
82 | /** |
||
83 | * Primary domain of this virtual host |
||
84 | * |
||
85 | * @var Domain |
||
86 | */ |
||
87 | protected $primarydomain; |
||
88 | /** |
||
89 | * List of all associated domains |
||
90 | * |
||
91 | * @var Domain[] |
||
92 | * @OneToMany(targetEntity="Tollwerk\Admin\Infrastructure\Model\Domain", mappedBy="vhost") |
||
93 | */ |
||
94 | protected $domains = []; |
||
95 | /** |
||
96 | * Document root directory |
||
97 | * |
||
98 | * @var string |
||
99 | * @Column(length=128) |
||
100 | */ |
||
101 | protected $docroot; |
||
102 | /** |
||
103 | * List of all associated protocol / port combinations |
||
104 | * |
||
105 | * @var Port[] |
||
106 | * @OneToMany(targetEntity="Tollwerk\Admin\Infrastructure\Model\Port", mappedBy="vhost") |
||
107 | */ |
||
108 | protected $ports = []; |
||
109 | /** |
||
110 | * Supported PHP version |
||
111 | * |
||
112 | * @var float|null |
||
113 | * @Column(type="decimal",precision=2,scale=1,nullable=true) |
||
114 | */ |
||
115 | protected $php = null; |
||
116 | /** |
||
117 | * Redirect URL |
||
118 | * |
||
119 | * @var string |
||
120 | * @Column(length=128, nullable=true) |
||
121 | */ |
||
122 | protected $redirecturl = null; |
||
123 | /** |
||
124 | * Redirect status |
||
125 | * |
||
126 | * @var int |
||
127 | * @Column(type="integer", nullable=false, options={"unsigned":true, "default":301}) |
||
128 | */ |
||
129 | protected $redirectstatus = \Tollwerk\Admin\Domain\Vhost\Vhost::REDIRECT_DEFAULT_STATUS; |
||
130 | |||
131 | /** |
||
132 | * Return the vhost ID |
||
133 | * |
||
134 | * @return int Vhost ID |
||
135 | */ |
||
136 | public function getId() |
||
140 | |||
141 | /** |
||
142 | * Set the vhost ID |
||
143 | * |
||
144 | * @param int $id Vhost ID |
||
145 | * @return Vhost |
||
146 | */ |
||
147 | public function setId($id) |
||
152 | |||
153 | /** |
||
154 | * Set whether this is an active vhost |
||
155 | * |
||
156 | * @param boolean $active Active vhost |
||
157 | * @return Vhost |
||
158 | */ |
||
159 | public function setActive($active) |
||
164 | |||
165 | /** |
||
166 | * Return whether the vhost is ative |
||
167 | * |
||
168 | * @return boolean Active vhost |
||
169 | */ |
||
170 | public function isActive() |
||
174 | |||
175 | /** |
||
176 | * Return the account this virtual host is belonging to |
||
177 | * |
||
178 | * @return Account Account |
||
179 | */ |
||
180 | public function getAccount() |
||
184 | |||
185 | /** |
||
186 | * Set the account this virtual host is belonging tp |
||
187 | * |
||
188 | * @param Account $account Account |
||
189 | * @return Vhost Self reference |
||
190 | */ |
||
191 | public function setAccount($account) |
||
196 | |||
197 | /** |
||
198 | * Return the virtual host type |
||
199 | * |
||
200 | * @return string Virtual host type |
||
201 | */ |
||
202 | public function getType() |
||
206 | |||
207 | /** |
||
208 | * Set the virtual host type |
||
209 | * |
||
210 | * @param string $type Virtual host type |
||
211 | * @return Vhost Self reference |
||
212 | */ |
||
213 | public function setType($type) |
||
218 | |||
219 | /** |
||
220 | * Return the associated domains |
||
221 | * |
||
222 | * @return Domain[] Associated domains |
||
223 | */ |
||
224 | public function getDomains() |
||
228 | |||
229 | /** |
||
230 | * Set the associated domains |
||
231 | * |
||
232 | * @param Domain[] $domains Associated domains |
||
233 | * @return Vhost Self reference |
||
234 | */ |
||
235 | public function setDomains(array $domains) |
||
240 | |||
241 | /** |
||
242 | * Return the primary domain of this virtual host |
||
243 | * |
||
244 | * @return Domain Primary domain |
||
245 | */ |
||
246 | public function getPrimarydomain() |
||
256 | |||
257 | /** |
||
258 | * Set the primary domain of this virtual host |
||
259 | * |
||
260 | * @param Domain $primarydomain Primary domain |
||
261 | * @return Vhost Self reference |
||
262 | */ |
||
263 | public function setPrimarydomain($primarydomain) |
||
268 | |||
269 | /** |
||
270 | * Return the document root |
||
271 | * |
||
272 | * @return string Document root |
||
273 | */ |
||
274 | public function getDocroot() |
||
278 | |||
279 | /** |
||
280 | * Set the document root |
||
281 | * |
||
282 | * @param string $docroot Document root |
||
283 | * @return Vhost Self reference |
||
284 | */ |
||
285 | public function setDocroot($docroot) |
||
290 | |||
291 | /** |
||
292 | * Return the associated protocols / port |
||
293 | * |
||
294 | * @return Port[] Associated protocols / port |
||
295 | */ |
||
296 | public function getPorts() |
||
300 | |||
301 | /** |
||
302 | * Set the associated protocols / port |
||
303 | * |
||
304 | * @param Port[] $ports Associated protocols / port |
||
305 | * @return Vhost Self reference |
||
306 | */ |
||
307 | public function setPorts(array $ports) |
||
312 | |||
313 | /** |
||
314 | * Return the supported PHP version |
||
315 | * |
||
316 | * @return float|null Supported PHP version |
||
317 | */ |
||
318 | public function getPhp() |
||
322 | |||
323 | /** |
||
324 | * Set the supported PHP version |
||
325 | * |
||
326 | * @param float|null $php Supported PHP version |
||
327 | * @return Vhost Self reference |
||
328 | */ |
||
329 | public function setPhp($php) |
||
334 | |||
335 | /** |
||
336 | * Return the redirect URL |
||
337 | * |
||
338 | * @return string Redirect URL |
||
339 | */ |
||
340 | public function getRedirecturl() |
||
344 | |||
345 | /** |
||
346 | * Set the redirect URL |
||
347 | * |
||
348 | * @param string $redirecturl Redirect URL |
||
349 | * @return Vhost Self reference |
||
350 | */ |
||
351 | public function setRedirecturl($redirecturl) |
||
356 | |||
357 | /** |
||
358 | * Return the redirect status |
||
359 | * |
||
360 | * @return int Redirect status |
||
361 | */ |
||
362 | public function getRedirectstatus() |
||
366 | |||
367 | /** |
||
368 | * Set the redirect status |
||
369 | * |
||
370 | * @param int $redirectstatus Redirect status |
||
371 | * @return Vhost Self reference |
||
372 | */ |
||
373 | public function setRedirectstatus($redirectstatus) |
||
378 | |||
379 | /** |
||
380 | * Release the primary domain on deletion of this virtual host |
||
381 | * |
||
382 | * @PreRemove |
||
383 | */ |
||
384 | public function releasePrimaryDomain() |
||
390 | } |
||
391 |