Passed
Branch master (41990d)
by Gabor
03:31
created

PolicyEntity::getResourceId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * WebHemi.
4
 *
5
 * PHP version 5.6
6
 *
7
 * @copyright 2012 - 2016 Gixx-web (http://www.gixx-web.com)
8
 * @license   https://opensource.org/licenses/MIT The MIT License (MIT)
9
 *
10
 * @link      http://www.gixx-web.com
11
 */
12
namespace WebHemi\Data\Entity\AccessManagement;
13
14
use DateTime;
15
use WebHemi\Data\Entity\DataEntityInterface;
16
17
/**
18
 * Class PolicyEntity.
19
 */
20
class PolicyEntity implements DataEntityInterface
21
{
22
    /** @var int */
23
    private $policyId;
24
    /** @var int */
25
    private $resourceId;
26
    /** @var int */
27
    private $applicationId;
28
    /** @var string */
29
    private $title;
30
    /** @var string */
31
    private $description;
32
    /** @var bool */
33
    private $isReadOnly;
34
    /** @var bool */
35
    private $isAllowed;
36
    /** @var DateTime */
37
    private $dateCreated;
38
    /** @var DateTime */
39
    private $dateModified;
40
41
    /**
42
     * Gets the value of the entity identifier.
43
     *
44
     * @return int
45
     */
46 1
    public function getKeyData()
47
    {
48 1
        return $this->policyId;
49
    }
50
51
    /**
52
     * @param int $policyId
53
     *
54
     * @return PolicyEntity
55
     */
56 7
    public function setPolicyId($policyId)
57
    {
58 7
        $this->policyId = $policyId;
59
60 7
        return $this;
61
    }
62
63
    /**
64
     * @return int
65
     */
66 2
    public function getPolicyId()
67
    {
68 2
        return $this->policyId;
69
    }
70
71
    /**
72
     * @param int $resource
73
     *
74
     * @return PolicyEntity
75
     */
76 8
    public function setResourceId($resource)
77
    {
78 8
        $this->resourceId = $resource;
79
80 8
        return $this;
81
    }
82
83
    /**
84
     * @return int
85
     */
86 3
    public function getResourceId()
87
    {
88 3
        return $this->resourceId;
89
    }
90
91
    /**
92
     * @param int $applicationId
93
     *
94
     * @return PolicyEntity
95
     */
96 8
    public function setApplicationId($applicationId)
97
    {
98 8
        $this->applicationId = $applicationId;
99
100 8
        return $this;
101
    }
102
103
    /**
104
     * @return int
105
     */
106 3
    public function getApplicationId()
107
    {
108 3
        return $this->applicationId;
109
    }
110
111
    /**
112
     * @param string $title
113
     *
114
     * @return PolicyEntity
115
     */
116 6
    public function setTitle($title)
117
    {
118 6
        $this->title = $title;
119
120 6
        return $this;
121
    }
122
123
    /**
124
     * @return string
125
     */
126 4
    public function getTitle()
127
    {
128 4
        return $this->title;
129
    }
130
131
    /**
132
     * @param string $description
133
     *
134
     * @return PolicyEntity
135
     */
136 6
    public function setDescription($description)
137
    {
138 6
        $this->description = $description;
139
140 6
        return $this;
141
    }
142
143
    /**
144
     * @return string
145
     */
146 1
    public function getDescription()
147
    {
148 1
        return $this->description;
149
    }
150
151
    /**
152
     * @param bool $state
153
     *
154
     * @return PolicyEntity
155
     */
156 8
    public function setReadOnly($state)
157
    {
158 8
        $this->isReadOnly = (bool) $state;
159
160 8
        return $this;
161
    }
162
163
    /**
164
     * @return bool
165
     */
166 4
    public function getReadOnly()
167
    {
168 4
        return $this->isReadOnly;
169
    }
170
171
    /**
172
     * @param bool $state
173
     *
174
     * @return PolicyEntity
175
     */
176 8
    public function setAllowed($state)
177
    {
178 8
        $this->isAllowed = (bool) $state;
179
180 8
        return $this;
181
    }
182
183
    /**
184
     * @return bool
185
     */
186 6
    public function getAllowed()
187
    {
188 6
        return $this->isAllowed;
189
    }
190
191
    /**
192
     * @param DateTime $dateCreated
193
     *
194
     * @return PolicyEntity
195
     */
196 6
    public function setDateCreated(DateTime $dateCreated)
197
    {
198 6
        $this->dateCreated = $dateCreated;
199
200 6
        return $this;
201
    }
202
203
    /**
204
     * @return DateTime
205
     */
206 2
    public function getDateCreated()
207
    {
208 2
        return $this->dateCreated;
209
    }
210
211
    /**
212
     * @param DateTime $dateModified
213
     *
214
     * @return PolicyEntity
215
     */
216 6
    public function setDateModified(DateTime $dateModified)
217
    {
218 6
        $this->dateModified = $dateModified;
219
220 6
        return $this;
221
    }
222
223
    /**
224
     * @return DateTime
225
     */
226 1
    public function getDateModified()
227
    {
228 1
        return $this->dateModified;
229
    }
230
}
231