1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* sysPass |
4
|
|
|
* |
5
|
|
|
* @author nuxsmin |
6
|
|
|
* @link https://syspass.org |
7
|
|
|
* @copyright 2012-2019, Rubén Domínguez nuxsmin@$syspass.org |
8
|
|
|
* |
9
|
|
|
* This file is part of sysPass. |
10
|
|
|
* |
11
|
|
|
* sysPass is free software: you can redistribute it and/or modify |
12
|
|
|
* it under the terms of the GNU General Public License as published by |
13
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
14
|
|
|
* (at your option) any later version. |
15
|
|
|
* |
16
|
|
|
* sysPass is distributed in the hope that it will be useful, |
17
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
18
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19
|
|
|
* GNU General Public License for more details. |
20
|
|
|
* |
21
|
|
|
* You should have received a copy of the GNU General Public License |
22
|
|
|
* along with sysPass. If not, see <http://www.gnu.org/licenses/>. |
23
|
|
|
*/ |
24
|
|
|
|
25
|
|
|
namespace SP\DataModel; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Class AccountSearchData |
29
|
|
|
* |
30
|
|
|
* @package SP\DataModel |
31
|
|
|
*/ |
32
|
|
|
class AccountSearchVData |
33
|
|
|
{ |
34
|
|
|
/** |
35
|
|
|
* @var int Id de la cuenta. |
36
|
|
|
*/ |
37
|
|
|
public $id = 0; |
38
|
|
|
/** |
39
|
|
|
* @var int Id del usuario principal de la cuenta. |
40
|
|
|
*/ |
41
|
|
|
public $userId = 0; |
42
|
|
|
/** |
43
|
|
|
* @var int Id del grupo principal de la cuenta. |
44
|
|
|
*/ |
45
|
|
|
public $userGroupId = 0; |
46
|
|
|
/** |
47
|
|
|
* @var int Id del usuario que editó la cuenta. |
48
|
|
|
*/ |
49
|
|
|
public $userEditId = 0; |
50
|
|
|
/** |
51
|
|
|
* @var string El nombre de la cuenta. |
52
|
|
|
*/ |
53
|
|
|
public $name = ''; |
54
|
|
|
/** |
55
|
|
|
* @var int Id del cliente de la cuenta. |
56
|
|
|
*/ |
57
|
|
|
public $clientId = 0; |
58
|
|
|
/** |
59
|
|
|
* @var int Id de la categoría de la cuenta. |
60
|
|
|
*/ |
61
|
|
|
public $categoryId = 0; |
62
|
|
|
/** |
63
|
|
|
* @var string El nombre de usuario de la cuenta. |
64
|
|
|
*/ |
65
|
|
|
public $login = ''; |
66
|
|
|
/** |
67
|
|
|
* @var string La URL de la cuenta. |
68
|
|
|
*/ |
69
|
|
|
public $url = ''; |
70
|
|
|
/** |
71
|
|
|
* @var string Las nosta de la cuenta. |
72
|
|
|
*/ |
73
|
|
|
public $notes = ''; |
74
|
|
|
/** |
75
|
|
|
* @var int |
76
|
|
|
*/ |
77
|
|
|
public $otherUserEdit = 0; |
78
|
|
|
/** |
79
|
|
|
* @var int |
80
|
|
|
*/ |
81
|
|
|
public $otherUserGroupEdit = 0; |
82
|
|
|
/** |
83
|
|
|
* @var int |
84
|
|
|
*/ |
85
|
|
|
public $isPrivate = 0; |
86
|
|
|
/** |
87
|
|
|
* @var int |
88
|
|
|
*/ |
89
|
|
|
public $isPrivateGroup = 0; |
90
|
|
|
/** |
91
|
|
|
* @var string |
92
|
|
|
*/ |
93
|
|
|
public $dateEdit; |
94
|
|
|
/** |
95
|
|
|
* @var int |
96
|
|
|
*/ |
97
|
|
|
public $passDate = 0; |
98
|
|
|
/** |
99
|
|
|
* @var int |
100
|
|
|
*/ |
101
|
|
|
public $passDateChange = 0; |
102
|
|
|
/** |
103
|
|
|
* @var int |
104
|
|
|
*/ |
105
|
|
|
public $parentId = 0; |
106
|
|
|
/** |
107
|
|
|
* @var string |
108
|
|
|
*/ |
109
|
|
|
public $categoryName = ''; |
110
|
|
|
/** |
111
|
|
|
* @var string |
112
|
|
|
*/ |
113
|
|
|
public $clientName = ''; |
114
|
|
|
/** |
115
|
|
|
* @var string |
116
|
|
|
*/ |
117
|
|
|
public $userGroupName = ''; |
118
|
|
|
/** |
119
|
|
|
* @var string |
120
|
|
|
*/ |
121
|
|
|
public $userName = ''; |
122
|
|
|
/** |
123
|
|
|
* @var string |
124
|
|
|
*/ |
125
|
|
|
public $userLogin = ''; |
126
|
|
|
/** |
127
|
|
|
* @var string |
128
|
|
|
*/ |
129
|
|
|
public $userEditName = ''; |
130
|
|
|
/** |
131
|
|
|
* @var string |
132
|
|
|
*/ |
133
|
|
|
public $userEditLogin = ''; |
134
|
|
|
/** |
135
|
|
|
* @var int |
136
|
|
|
*/ |
137
|
|
|
public $num_files = 0; |
138
|
|
|
/** |
139
|
|
|
* @var string |
140
|
|
|
*/ |
141
|
|
|
public $publicLinkHash; |
142
|
|
|
/** |
143
|
|
|
* @var int |
144
|
|
|
*/ |
145
|
|
|
public $publicLinkDateExpire; |
146
|
|
|
/** |
147
|
|
|
* @var int |
148
|
|
|
*/ |
149
|
|
|
public $publicLinkTotalCountViews; |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* AccountData constructor. |
153
|
|
|
* |
154
|
|
|
* @param int $accountId |
155
|
|
|
*/ |
156
|
|
|
public function __construct($accountId = 0) |
157
|
|
|
{ |
158
|
|
|
$this->id = (int)$accountId; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* @return int |
163
|
|
|
*/ |
164
|
|
|
public function getUserEditId() |
165
|
|
|
{ |
166
|
|
|
return (int)$this->userEditId; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* @param int $userEditId |
171
|
|
|
*/ |
172
|
|
|
public function setUserEditId($userEditId) |
173
|
|
|
{ |
174
|
|
|
$this->userEditId = (int)$userEditId; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* @return int|null |
179
|
|
|
*/ |
180
|
|
|
public function getId() |
181
|
|
|
{ |
182
|
|
|
return (int)$this->id; |
183
|
|
|
} |
184
|
|
|
|
185
|
|
|
/** |
186
|
|
|
* @param int $id |
187
|
|
|
*/ |
188
|
|
|
public function setId($id) |
189
|
|
|
{ |
190
|
|
|
$this->id = (int)$id; |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* @return int |
195
|
|
|
*/ |
196
|
|
|
public function getUserId() |
197
|
|
|
{ |
198
|
|
|
return (int)$this->userId; |
199
|
|
|
} |
200
|
|
|
|
201
|
|
|
/** |
202
|
|
|
* @param int $userId |
203
|
|
|
*/ |
204
|
|
|
public function setUserId($userId) |
205
|
|
|
{ |
206
|
|
|
$this->userId = (int)$userId; |
207
|
|
|
} |
208
|
|
|
|
209
|
|
|
/** |
210
|
|
|
* @return int |
211
|
|
|
*/ |
212
|
|
|
public function getUserGroupId() |
213
|
|
|
{ |
214
|
|
|
return (int)$this->userGroupId; |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* @param int $userGroupId |
219
|
|
|
*/ |
220
|
|
|
public function setUserGroupId($userGroupId) |
221
|
|
|
{ |
222
|
|
|
$this->userGroupId = (int)$userGroupId; |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
/** |
226
|
|
|
* @return int |
227
|
|
|
*/ |
228
|
|
|
public function getOtherUserEdit() |
229
|
|
|
{ |
230
|
|
|
return (int)$this->otherUserEdit; |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
/** |
234
|
|
|
* @param bool $otherUserEdit |
235
|
|
|
*/ |
236
|
|
|
public function setOtherUserEdit($otherUserEdit) |
237
|
|
|
{ |
238
|
|
|
$this->otherUserEdit = (int)$otherUserEdit; |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
/** |
242
|
|
|
* @return int |
243
|
|
|
*/ |
244
|
|
|
public function getOtherUserGroupEdit() |
245
|
|
|
{ |
246
|
|
|
return (int)$this->otherUserGroupEdit; |
247
|
|
|
} |
248
|
|
|
|
249
|
|
|
/** |
250
|
|
|
* @param bool $otherUserGroupEdit |
251
|
|
|
*/ |
252
|
|
|
public function setOtherUserGroupEdit($otherUserGroupEdit) |
253
|
|
|
{ |
254
|
|
|
$this->otherUserGroupEdit = (int)$otherUserGroupEdit; |
255
|
|
|
} |
256
|
|
|
|
257
|
|
|
/** |
258
|
|
|
* @return string |
259
|
|
|
*/ |
260
|
|
|
public function getName() |
261
|
|
|
{ |
262
|
|
|
return $this->name; |
263
|
|
|
} |
264
|
|
|
|
265
|
|
|
/** |
266
|
|
|
* @param string $name |
267
|
|
|
*/ |
268
|
|
|
public function setName($name) |
269
|
|
|
{ |
270
|
|
|
$this->name = $name; |
271
|
|
|
} |
272
|
|
|
|
273
|
|
|
/** |
274
|
|
|
* @return int |
275
|
|
|
*/ |
276
|
|
|
public function getCategoryId() |
277
|
|
|
{ |
278
|
|
|
return (int)$this->categoryId; |
279
|
|
|
} |
280
|
|
|
|
281
|
|
|
/** |
282
|
|
|
* @param int $categoryId |
283
|
|
|
*/ |
284
|
|
|
public function setCategoryId($categoryId) |
285
|
|
|
{ |
286
|
|
|
$this->categoryId = (int)$categoryId; |
287
|
|
|
} |
288
|
|
|
|
289
|
|
|
/** |
290
|
|
|
* @return int |
291
|
|
|
*/ |
292
|
|
|
public function getClientId() |
293
|
|
|
{ |
294
|
|
|
return (int)$this->clientId; |
295
|
|
|
} |
296
|
|
|
|
297
|
|
|
/** |
298
|
|
|
* @param int $clientId |
299
|
|
|
*/ |
300
|
|
|
public function setClientId($clientId) |
301
|
|
|
{ |
302
|
|
|
$this->clientId = (int)$clientId; |
303
|
|
|
} |
304
|
|
|
|
305
|
|
|
/** |
306
|
|
|
* @return string |
307
|
|
|
*/ |
308
|
|
|
public function getLogin() |
309
|
|
|
{ |
310
|
|
|
return $this->login; |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* @param string $login |
315
|
|
|
*/ |
316
|
|
|
public function setLogin($login) |
317
|
|
|
{ |
318
|
|
|
$this->login = $login; |
319
|
|
|
} |
320
|
|
|
|
321
|
|
|
/** |
322
|
|
|
* @return string |
323
|
|
|
*/ |
324
|
|
|
public function getUrl() |
325
|
|
|
{ |
326
|
|
|
return $this->url; |
327
|
|
|
} |
328
|
|
|
|
329
|
|
|
/** |
330
|
|
|
* @param string $url |
331
|
|
|
*/ |
332
|
|
|
public function setUrl($url) |
333
|
|
|
{ |
334
|
|
|
$this->url = $url; |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
/** |
338
|
|
|
* @return string |
339
|
|
|
*/ |
340
|
|
|
public function getNotes() |
341
|
|
|
{ |
342
|
|
|
return $this->notes; |
343
|
|
|
} |
344
|
|
|
|
345
|
|
|
/** |
346
|
|
|
* @param string $notes |
347
|
|
|
*/ |
348
|
|
|
public function setNotes($notes) |
349
|
|
|
{ |
350
|
|
|
$this->notes = $notes; |
351
|
|
|
} |
352
|
|
|
|
353
|
|
|
/** |
354
|
|
|
* @return int |
355
|
|
|
*/ |
356
|
|
|
public function getIsPrivate() |
357
|
|
|
{ |
358
|
|
|
return (int)$this->isPrivate; |
359
|
|
|
} |
360
|
|
|
|
361
|
|
|
/** |
362
|
|
|
* @param int $isPrivate |
363
|
|
|
*/ |
364
|
|
|
public function setIsPrivate($isPrivate) |
365
|
|
|
{ |
366
|
|
|
$this->isPrivate = (int)$isPrivate; |
367
|
|
|
} |
368
|
|
|
|
369
|
|
|
/** |
370
|
|
|
* @return int |
371
|
|
|
*/ |
372
|
|
|
public function getPassDate() |
373
|
|
|
{ |
374
|
|
|
return (int)$this->passDate; |
375
|
|
|
} |
376
|
|
|
|
377
|
|
|
/** |
378
|
|
|
* @param int $passDate |
379
|
|
|
*/ |
380
|
|
|
public function setPassDate($passDate) |
381
|
|
|
{ |
382
|
|
|
$this->passDate = (int)$passDate; |
383
|
|
|
} |
384
|
|
|
|
385
|
|
|
/** |
386
|
|
|
* @return int |
387
|
|
|
*/ |
388
|
|
|
public function getPassDateChange() |
389
|
|
|
{ |
390
|
|
|
return (int)$this->passDateChange; |
391
|
|
|
} |
392
|
|
|
|
393
|
|
|
/** |
394
|
|
|
* @param int $passDateChange |
395
|
|
|
*/ |
396
|
|
|
public function setPassDateChange($passDateChange) |
397
|
|
|
{ |
398
|
|
|
$this->passDateChange = (int)$passDateChange; |
399
|
|
|
} |
400
|
|
|
|
401
|
|
|
/** |
402
|
|
|
* @return int |
403
|
|
|
*/ |
404
|
|
|
public function getParentId() |
405
|
|
|
{ |
406
|
|
|
return (int)$this->parentId; |
407
|
|
|
} |
408
|
|
|
|
409
|
|
|
/** |
410
|
|
|
* @param int $parentId |
411
|
|
|
*/ |
412
|
|
|
public function setParentId($parentId) |
413
|
|
|
{ |
414
|
|
|
$this->parentId = (int)$parentId; |
415
|
|
|
} |
416
|
|
|
|
417
|
|
|
/** |
418
|
|
|
* @return int |
419
|
|
|
*/ |
420
|
|
|
public function getIsPrivateGroup() |
421
|
|
|
{ |
422
|
|
|
return (int)$this->isPrivateGroup; |
423
|
|
|
} |
424
|
|
|
|
425
|
|
|
/** |
426
|
|
|
* @param int $isPrivateGroup |
427
|
|
|
*/ |
428
|
|
|
public function setIsPrivateGroup($isPrivateGroup) |
429
|
|
|
{ |
430
|
|
|
$this->isPrivateGroup = (int)$isPrivateGroup; |
431
|
|
|
} |
432
|
|
|
|
433
|
|
|
/** |
434
|
|
|
* @return string |
435
|
|
|
*/ |
436
|
|
|
public function getUserEditName() |
437
|
|
|
{ |
438
|
|
|
return $this->userEditName; |
439
|
|
|
} |
440
|
|
|
|
441
|
|
|
/** |
442
|
|
|
* @return string |
443
|
|
|
*/ |
444
|
|
|
public function getUserEditLogin() |
445
|
|
|
{ |
446
|
|
|
return $this->userEditLogin; |
447
|
|
|
} |
448
|
|
|
|
449
|
|
|
/** |
450
|
|
|
* @return string |
451
|
|
|
*/ |
452
|
|
|
public function getCategoryName() |
453
|
|
|
{ |
454
|
|
|
return $this->categoryName; |
455
|
|
|
} |
456
|
|
|
|
457
|
|
|
/** |
458
|
|
|
* @return string |
459
|
|
|
*/ |
460
|
|
|
public function getClientName() |
461
|
|
|
{ |
462
|
|
|
return $this->clientName; |
463
|
|
|
} |
464
|
|
|
|
465
|
|
|
/** |
466
|
|
|
* @return string |
467
|
|
|
*/ |
468
|
|
|
public function getUserGroupName() |
469
|
|
|
{ |
470
|
|
|
return $this->userGroupName; |
471
|
|
|
} |
472
|
|
|
|
473
|
|
|
/** |
474
|
|
|
* @return string |
475
|
|
|
*/ |
476
|
|
|
public function getUserName() |
477
|
|
|
{ |
478
|
|
|
return $this->userName; |
479
|
|
|
} |
480
|
|
|
|
481
|
|
|
/** |
482
|
|
|
* @return string |
483
|
|
|
*/ |
484
|
|
|
public function getUserLogin() |
485
|
|
|
{ |
486
|
|
|
return $this->userLogin; |
487
|
|
|
} |
488
|
|
|
|
489
|
|
|
/** |
490
|
|
|
* @return int |
491
|
|
|
*/ |
492
|
|
|
public function getNumFiles() |
493
|
|
|
{ |
494
|
|
|
return (int)$this->num_files; |
495
|
|
|
} |
496
|
|
|
|
497
|
|
|
/** |
498
|
|
|
* @param int $num_files |
499
|
|
|
*/ |
500
|
|
|
public function setNumFiles($num_files) |
501
|
|
|
{ |
502
|
|
|
$this->num_files = (int)$num_files; |
503
|
|
|
} |
504
|
|
|
|
505
|
|
|
/** |
506
|
|
|
* @return string |
507
|
|
|
*/ |
508
|
|
|
public function getDateEdit() |
509
|
|
|
{ |
510
|
|
|
return $this->dateEdit; |
511
|
|
|
} |
512
|
|
|
|
513
|
|
|
/** |
514
|
|
|
* @param string $dateEdit |
515
|
|
|
*/ |
516
|
|
|
public function setDateEdit($dateEdit) |
517
|
|
|
{ |
518
|
|
|
$this->dateEdit = $dateEdit; |
519
|
|
|
} |
520
|
|
|
|
521
|
|
|
/** |
522
|
|
|
* @return int |
523
|
|
|
*/ |
524
|
|
|
public function getPublicLinkDateExpire(): int |
525
|
|
|
{ |
526
|
|
|
return (int)$this->publicLinkDateExpire; |
527
|
|
|
} |
528
|
|
|
|
529
|
|
|
/** |
530
|
|
|
* @param int $publicLinkDateExpire |
531
|
|
|
*/ |
532
|
|
|
public function setPublicLinkDateExpire(int $publicLinkDateExpire) |
533
|
|
|
{ |
534
|
|
|
$this->publicLinkDateExpire = $publicLinkDateExpire; |
535
|
|
|
} |
536
|
|
|
|
537
|
|
|
/** |
538
|
|
|
* @return int |
539
|
|
|
*/ |
540
|
|
|
public function getPublicLinkTotalCountViews(): int |
541
|
|
|
{ |
542
|
|
|
return (int)$this->publicLinkTotalCountViews; |
543
|
|
|
} |
544
|
|
|
|
545
|
|
|
/** |
546
|
|
|
* @param int $publicLinkTotalCountViews |
547
|
|
|
*/ |
548
|
|
|
public function setPublicLinkTotalCountViews(int $publicLinkTotalCountViews) |
549
|
|
|
{ |
550
|
|
|
$this->publicLinkTotalCountViews = $publicLinkTotalCountViews; |
551
|
|
|
} |
552
|
|
|
|
553
|
|
|
/** |
554
|
|
|
* @return string |
555
|
|
|
*/ |
556
|
|
|
public function getPublicLinkHash() |
557
|
|
|
{ |
558
|
|
|
return $this->publicLinkHash; |
559
|
|
|
} |
560
|
|
|
|
561
|
|
|
/** |
562
|
|
|
* @param string $publicLinkHash |
563
|
|
|
*/ |
564
|
|
|
public function setPublicLinkHash(string $publicLinkHash) |
565
|
|
|
{ |
566
|
|
|
$this->publicLinkHash = $publicLinkHash; |
567
|
|
|
} |
568
|
|
|
} |