1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* admin |
5
|
|
|
* |
6
|
|
|
* @category Tollwerk |
7
|
|
|
* @package Tollwerk\Admin |
8
|
|
|
* @subpackage Tollwerk\Admin\Infrastructure\Model |
9
|
|
|
* @author Joschi Kuphal <[email protected]> / @jkphl |
10
|
|
|
* @copyright Copyright © 2018 Joschi Kuphal <[email protected]> / @jkphl |
11
|
|
|
* @license http://opensource.org/licenses/MIT The MIT License (MIT) |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
/*********************************************************************************** |
15
|
|
|
* The MIT License (MIT) |
16
|
|
|
* |
17
|
|
|
* Copyright © 2018 Joschi Kuphal <[email protected]> / @jkphl |
18
|
|
|
* |
19
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of |
20
|
|
|
* this software and associated documentation files (the "Software"), to deal in |
21
|
|
|
* the Software without restriction, including without limitation the rights to |
22
|
|
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
23
|
|
|
* the Software, and to permit persons to whom the Software is furnished to do so, |
24
|
|
|
* subject to the following conditions: |
25
|
|
|
* |
26
|
|
|
* The above copyright notice and this permission notice shall be included in all |
27
|
|
|
* copies or substantial portions of the Software. |
28
|
|
|
* |
29
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
30
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
31
|
|
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
32
|
|
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
33
|
|
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
34
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
35
|
|
|
***********************************************************************************/ |
36
|
|
|
|
37
|
|
|
namespace Tollwerk\Admin\Infrastructure\Model; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Account model |
41
|
|
|
* |
42
|
|
|
* @package Tollwerk\Admin |
43
|
|
|
* @subpackage Tollwerk\Admin\Infrastructure |
44
|
|
|
* @Entity |
45
|
|
|
* @Table(name="account") |
46
|
|
|
*/ |
47
|
|
|
class Account |
48
|
|
|
{ |
49
|
|
|
/** |
50
|
|
|
* Account ID |
51
|
|
|
* |
52
|
|
|
* @var integer |
53
|
|
|
* @Id @Column(type="integer") |
54
|
|
|
* @GeneratedValue |
55
|
|
|
*/ |
56
|
|
|
protected $id; |
57
|
|
|
/** |
58
|
|
|
* Active |
59
|
|
|
* |
60
|
|
|
* @var boolean |
61
|
|
|
* @Column(type="boolean") |
62
|
|
|
*/ |
63
|
|
|
protected $active; |
64
|
|
|
/** |
65
|
|
|
* Account name |
66
|
|
|
* |
67
|
|
|
* @var string |
68
|
|
|
* @Column(length=64,unique=true) |
69
|
|
|
*/ |
70
|
|
|
protected $name; |
71
|
|
|
/** |
72
|
|
|
* List of all associated domains |
73
|
|
|
* |
74
|
|
|
* @var Domain[] |
75
|
|
|
* @OneToMany(targetEntity="Tollwerk\Admin\Infrastructure\Model\Domain", mappedBy="account") |
76
|
|
|
*/ |
77
|
|
|
protected $domains; |
78
|
|
|
/** |
79
|
|
|
* List of all associated virtual hosts |
80
|
|
|
* |
81
|
|
|
* @var Vhost[] |
82
|
|
|
* @OneToMany(targetEntity="Tollwerk\Admin\Infrastructure\Model\Vhost", mappedBy="account") |
83
|
|
|
*/ |
84
|
|
|
protected $vhosts; |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* Return the account ID |
88
|
|
|
* |
89
|
|
|
* @return int Account ID |
90
|
|
|
*/ |
91
|
|
|
public function getId() |
92
|
|
|
{ |
93
|
|
|
return $this->id; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* Set the account ID |
98
|
|
|
* |
99
|
|
|
* @param int $id Account ID |
100
|
|
|
* @return Account |
101
|
|
|
*/ |
102
|
|
|
public function setId($id) |
103
|
|
|
{ |
104
|
|
|
$this->id = $id; |
105
|
|
|
return $this; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* Return the account name |
110
|
|
|
* |
111
|
|
|
* @return string Account name |
112
|
|
|
*/ |
113
|
|
|
public function getName() |
114
|
|
|
{ |
115
|
|
|
return $this->name; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* Set the account name |
120
|
|
|
* |
121
|
|
|
* @param string $name Account name |
122
|
|
|
* @return Account |
123
|
|
|
*/ |
124
|
|
|
public function setName($name) |
125
|
|
|
{ |
126
|
|
|
$this->name = $name; |
127
|
|
|
return $this; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* Return whether this account is active |
132
|
|
|
* |
133
|
|
|
* @return bool Active account |
134
|
|
|
*/ |
135
|
|
|
public function getActive() { |
136
|
|
|
return $this->active; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* Set whether this is an active account |
141
|
|
|
* |
142
|
|
|
* @param boolean $active Active account |
143
|
|
|
* @return Account |
144
|
|
|
*/ |
145
|
|
|
public function setActive($active) |
146
|
|
|
{ |
147
|
|
|
$this->active = $active; |
148
|
|
|
return $this; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* Return whether the account is ative |
153
|
|
|
* |
154
|
|
|
* @return boolean Active account |
155
|
|
|
*/ |
156
|
|
|
public function isActive() |
157
|
|
|
{ |
158
|
|
|
return $this->active; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* Return the associated domains |
163
|
|
|
* |
164
|
|
|
* @return Domain[] Associated domains |
165
|
|
|
*/ |
166
|
|
|
public function getDomains() |
167
|
|
|
{ |
168
|
|
|
return $this->domains; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* Set the associated domains |
173
|
|
|
* |
174
|
|
|
* @param Domain[] $domains Associated domains |
175
|
|
|
* @return Account Self reference |
176
|
|
|
*/ |
177
|
|
|
public function setDomains($domains) |
178
|
|
|
{ |
179
|
|
|
$this->domains = $domains; |
180
|
|
|
return $this; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* Return the associated virtual hosts |
185
|
|
|
* |
186
|
|
|
* @return Vhost[] Associated virtual hosts |
187
|
|
|
*/ |
188
|
|
|
public function getVhosts() |
189
|
|
|
{ |
190
|
|
|
return $this->vhosts; |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* Set the associated virtual hosts |
195
|
|
|
* |
196
|
|
|
* @param Vhost[] $vhosts Associated virtual hosts |
197
|
|
|
* @return Account Self reference |
198
|
|
|
*/ |
199
|
|
|
public function setVhosts($vhosts) |
200
|
|
|
{ |
201
|
|
|
$this->domains = $vhosts; |
|
|
|
|
202
|
|
|
return $this; |
203
|
|
|
} |
204
|
|
|
} |
205
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..