Passed
Push — devel-3.0 ( af8b21...5a06ca )
by Rubén
03:22
created

AccountPermission::getUsersEdit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * sysPass
4
 *
5
 * @author nuxsmin
6
 * @link https://syspass.org
7
 * @copyright 2012-2018, 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\ItemPreset;
26
27
/**
28
 * Class AccountPermission
29
 *
30
 * @package SP\DataModel
31
 */
32
class AccountPermission
33
{
34
    /**
35
     * @var array
36
     */
37
    private $usersView = [];
38
    /**
39
     * @var array
40
     */
41
    private $usersEdit = [];
42
    /**
43
     * @var array
44
     */
45
    private $userGroupsView = [];
46
    /**
47
     * @var array
48
     */
49
    private $userGroupsEdit = [];
50
51
    /**
52
     * @return array
53
     */
54
    public function getUsersView(): array
55
    {
56
        return $this->usersView;
57
    }
58
59
    /**
60
     * @param array $usersView
61
     *
62
     * @return AccountPermission
63
     */
64
    public function setUsersView(array $usersView)
65
    {
66
        $this->usersView = $usersView;
67
68
        return $this;
69
    }
70
71
    /**
72
     * @return array
73
     */
74
    public function getUsersEdit(): array
75
    {
76
        return $this->usersEdit;
77
    }
78
79
    /**
80
     * @param array $usersEdit
81
     *
82
     * @return AccountPermission
83
     */
84
    public function setUsersEdit(array $usersEdit)
85
    {
86
        $this->usersEdit = $usersEdit;
87
88
        return $this;
89
    }
90
91
    /**
92
     * @return array
93
     */
94
    public function getUserGroupsView(): array
95
    {
96
        return $this->userGroupsView;
97
    }
98
99
    /**
100
     * @param array $userGroupsView
101
     *
102
     * @return AccountPermission
103
     */
104
    public function setUserGroupsView(array $userGroupsView)
105
    {
106
        $this->userGroupsView = $userGroupsView;
107
108
        return $this;
109
    }
110
111
    /**
112
     * @return array
113
     */
114
    public function getUserGroupsEdit(): array
115
    {
116
        return $this->userGroupsEdit;
117
    }
118
119
    /**
120
     * @param array $userGroupsEdit
121
     *
122
     * @return AccountPermission
123
     */
124
    public function setUserGroupsEdit(array $userGroupsEdit)
125
    {
126
        $this->userGroupsEdit = $userGroupsEdit;
127
128
        return $this;
129
    }
130
131
    /**
132
     * @return bool
133
     */
134
    public function hasItems()
135
    {
136
        return count($this->usersView) > 0
137
            || count($this->usersEdit) > 0
138
            || count($this->userGroupsView) > 0
139
            || count($this->userGroupsEdit) > 0;
140
    }
141
}