|
1
|
|
|
<?php |
|
2
|
|
|
namespace AppBundle\Entity; |
|
3
|
|
|
|
|
4
|
|
|
use DateTime; |
|
5
|
|
|
|
|
6
|
|
|
/** |
|
7
|
|
|
* NodeAccess |
|
8
|
|
|
*/ |
|
9
|
|
|
class NodeAccess extends AbstractEntity |
|
10
|
|
|
{ |
|
11
|
|
|
const BOOKMARK_NO = 'no'; |
|
12
|
|
|
const BOOKMARK_YES = 'yes'; |
|
13
|
|
|
|
|
14
|
|
|
const PERMISSION_ACCESS = 'access'; |
|
15
|
|
|
const PERMISSION_BAN = 'ban'; |
|
16
|
|
|
const PERMISSION_EXECUTE = 'execute'; |
|
17
|
|
|
const PERMISSION_MASTER = 'master'; |
|
18
|
|
|
const PERMISSION_OP = 'op'; |
|
19
|
|
|
const PERMISSION_SILENCE = 'silence'; |
|
20
|
|
|
|
|
21
|
|
|
const K_NO = 'no'; |
|
22
|
|
|
const K_YES = 'yes'; |
|
23
|
|
|
|
|
24
|
|
|
//region Column properties |
|
25
|
|
|
|
|
26
|
|
|
/** @var integer */ |
|
27
|
|
|
protected $nodeId; |
|
28
|
|
|
|
|
29
|
|
|
/** @var integer */ |
|
30
|
|
|
protected $userId; |
|
31
|
|
|
|
|
32
|
|
|
/** @var string */ |
|
33
|
|
|
protected $bookmark = self::BOOKMARK_NO; |
|
34
|
|
|
|
|
35
|
|
|
/** @var string */ |
|
36
|
|
|
protected $permission; |
|
37
|
|
|
|
|
38
|
|
|
/** @var integer */ |
|
39
|
|
|
protected $nodeUserSubchildCount; |
|
40
|
|
|
|
|
41
|
|
|
/** @var DateTime */ |
|
42
|
|
|
protected $lastVisitAt; |
|
43
|
|
|
|
|
44
|
|
|
/** @var integer */ |
|
45
|
|
|
protected $visits; |
|
46
|
|
|
|
|
47
|
|
|
/** @var integer */ |
|
48
|
|
|
protected $bookmarkCategoryNodeId; |
|
49
|
|
|
|
|
50
|
|
|
/** @var string */ |
|
51
|
|
|
protected $givenK = self::K_NO; |
|
52
|
|
|
|
|
53
|
|
|
//endregion |
|
54
|
|
|
|
|
55
|
|
|
//region Association properties |
|
56
|
|
|
|
|
57
|
|
|
/** @var Node */ |
|
58
|
|
|
protected $node; |
|
59
|
|
|
|
|
60
|
|
|
/** @var User */ |
|
61
|
|
|
protected $user; |
|
62
|
|
|
|
|
63
|
|
|
/** @var Node */ |
|
64
|
|
|
protected $bookmarkCategory; |
|
65
|
|
|
|
|
66
|
|
|
//endregion |
|
67
|
|
|
|
|
68
|
|
|
//region Column methods |
|
69
|
|
|
|
|
70
|
|
|
public function getNodeId() |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->nodeId; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
public function setNodeId($nodeId) |
|
76
|
|
|
{ |
|
77
|
|
|
$this->nodeId = $nodeId; |
|
78
|
|
|
|
|
79
|
|
|
return $this; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function getUserId() |
|
83
|
|
|
{ |
|
84
|
|
|
return $this->userId; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
public function setUserId($userId) |
|
88
|
|
|
{ |
|
89
|
|
|
$this->userId = $userId; |
|
90
|
|
|
|
|
91
|
|
|
return $this; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
public function getBookmark() |
|
95
|
|
|
{ |
|
96
|
|
|
return $this->bookmark; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
public function setBookmark($bookmark) |
|
100
|
|
|
{ |
|
101
|
|
|
$this->bookmark = $bookmark; |
|
102
|
|
|
|
|
103
|
|
|
return $this; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
public function getPermission() |
|
107
|
|
|
{ |
|
108
|
|
|
return $this->permission; |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
public function setPermission($permission) |
|
112
|
|
|
{ |
|
113
|
|
|
$this->permission = $permission; |
|
114
|
|
|
|
|
115
|
|
|
return $this; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
public function getNodeUserSubchildCount() |
|
119
|
|
|
{ |
|
120
|
|
|
return $this->nodeUserSubchildCount; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
public function setNodeUserSubchildCount($nodeUserSubchildCount) |
|
124
|
|
|
{ |
|
125
|
|
|
$this->nodeUserSubchildCount = $nodeUserSubchildCount; |
|
126
|
|
|
|
|
127
|
|
|
return $this; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
public function getLastVisitAt() |
|
131
|
|
|
{ |
|
132
|
|
|
return $this->lastVisitAt; |
|
133
|
|
|
} |
|
134
|
|
|
|
|
135
|
|
|
public function setLastVisitAt($lastVisitAt) |
|
136
|
|
|
{ |
|
137
|
|
|
$this->lastVisitAt = $lastVisitAt; |
|
138
|
|
|
|
|
139
|
|
|
return $this; |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
public function getVisits() |
|
143
|
|
|
{ |
|
144
|
|
|
return $this->visits; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
public function setVisits($visits) |
|
148
|
|
|
{ |
|
149
|
|
|
$this->visits = $visits; |
|
150
|
|
|
|
|
151
|
|
|
return $this; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
public function getBookmarkCategoryNodeId() |
|
155
|
|
|
{ |
|
156
|
|
|
return $this->bookmarkCategoryNodeId; |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
public function setBookmarkCategoryNodeId($bookmarkCategoryNodeId) |
|
160
|
|
|
{ |
|
161
|
|
|
$this->bookmarkCategoryNodeId = $bookmarkCategoryNodeId; |
|
162
|
|
|
|
|
163
|
|
|
return $this; |
|
164
|
|
|
} |
|
165
|
|
|
|
|
166
|
|
|
public function getGivenK() |
|
167
|
|
|
{ |
|
168
|
|
|
return $this->givenK; |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
public function setGivenK($givenK) |
|
172
|
|
|
{ |
|
173
|
|
|
$this->givenK = $givenK; |
|
174
|
|
|
|
|
175
|
|
|
return $this; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
//endregion |
|
179
|
|
|
|
|
180
|
|
|
//region Association methods |
|
181
|
|
|
|
|
182
|
|
|
public function getNode() |
|
183
|
|
|
{ |
|
184
|
|
|
return $this->node; |
|
185
|
|
|
} |
|
186
|
|
|
|
|
187
|
|
|
public function setNode(Node $node) |
|
188
|
|
|
{ |
|
189
|
|
|
$this->node = $node; |
|
190
|
|
|
|
|
191
|
|
|
return $this; |
|
192
|
|
|
} |
|
193
|
|
|
|
|
194
|
|
|
public function getUser() |
|
195
|
|
|
{ |
|
196
|
|
|
return $this->user; |
|
197
|
|
|
} |
|
198
|
|
|
|
|
199
|
|
|
public function setUser(User $user) |
|
200
|
|
|
{ |
|
201
|
|
|
$this->user = $user; |
|
202
|
|
|
|
|
203
|
|
|
return $this; |
|
204
|
|
|
} |
|
205
|
|
|
|
|
206
|
|
|
public function getBookmarkCategory() |
|
207
|
|
|
{ |
|
208
|
|
|
return $this->bookmarkCategory; |
|
209
|
|
|
} |
|
210
|
|
|
|
|
211
|
|
|
public function setBookmarkCategory(Node $bookmarkCategory) |
|
212
|
|
|
{ |
|
213
|
|
|
$this->bookmarkCategory = $bookmarkCategory; |
|
214
|
|
|
|
|
215
|
|
|
return $this; |
|
216
|
|
|
} |
|
217
|
|
|
|
|
218
|
|
|
//endregion |
|
219
|
|
|
} |
|
220
|
|
|
|