1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace kalanis\kw_accounts\Data; |
4
|
|
|
|
5
|
|
|
|
6
|
|
|
use kalanis\kw_accounts\Interfaces\IGroup; |
7
|
|
|
|
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Class FileGroup |
11
|
|
|
* @package kalanis\kw_accounts\Data |
12
|
|
|
*/ |
13
|
|
|
class FileGroup implements IGroup |
14
|
|
|
{ |
15
|
|
|
protected string $id = '0'; |
16
|
|
|
protected string $name = ''; |
17
|
|
|
protected string $author = '0'; |
18
|
|
|
protected string $displayName = ''; |
19
|
|
|
protected int $status = 0; |
20
|
|
|
/** @var string[] */ |
21
|
|
|
protected array $parents = []; |
22
|
|
|
/** @var array<string|int, string|int|float|bool> */ |
23
|
|
|
protected array $extra = []; |
24
|
|
|
|
25
|
1 |
|
public function setGroupData(?string $id, ?string $name, ?string $desc, ?string $authorId, ?int $status, ?array $parents = [], ?array $extra = []): void |
26
|
|
|
{ |
27
|
1 |
|
$this->id = $id ?? $this->id; |
28
|
1 |
|
$this->name = $name ?? $this->name; |
29
|
1 |
|
$this->displayName = $desc ?? $this->displayName; |
30
|
1 |
|
$this->author = $authorId ?? $this->author; |
31
|
1 |
|
$this->status = $status ?? $this->status; |
32
|
1 |
|
$this->parents = $parents ?? $this->parents; |
33
|
1 |
|
$this->extra = !is_null($extra) ? array_merge($this->extra, $extra) : $this->extra; |
|
|
|
|
34
|
1 |
|
} |
35
|
|
|
|
36
|
1 |
|
public function getGroupId(): string |
37
|
|
|
{ |
38
|
1 |
|
return $this->id; |
39
|
|
|
} |
40
|
|
|
|
41
|
1 |
|
public function getGroupName(): string |
42
|
|
|
{ |
43
|
1 |
|
return $this->name; |
44
|
|
|
} |
45
|
|
|
|
46
|
1 |
|
public function getGroupAuthorId(): string |
47
|
|
|
{ |
48
|
1 |
|
return $this->author; |
49
|
|
|
} |
50
|
|
|
|
51
|
1 |
|
public function getGroupDesc(): string |
52
|
|
|
{ |
53
|
1 |
|
return $this->displayName; |
54
|
|
|
} |
55
|
|
|
|
56
|
1 |
|
public function getGroupStatus(): int |
57
|
|
|
{ |
58
|
1 |
|
return $this->status; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @return string[] |
63
|
|
|
*/ |
64
|
1 |
|
public function getGroupParents(): array |
65
|
|
|
{ |
66
|
1 |
|
return $this->parents; |
67
|
|
|
} |
68
|
|
|
|
69
|
1 |
|
public function getGroupExtra(): array |
70
|
|
|
{ |
71
|
1 |
|
return $this->extra; |
72
|
|
|
} |
73
|
|
|
} |
74
|
|
|
|