Passed
Push — master ( 64ab61...b96172 )
by Gabor
09:36
created

PolicyEntity::setApplicationId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
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
    public function getKeyData()
47
    {
48
        return $this->policyId;
49
    }
50
51
    /**
52
     * @param int $policyId
53
     *
54
     * @return PolicyEntity
55
     */
56
    public function setPolicyId($policyId)
57
    {
58
        $this->policyId = $policyId;
59
60
        return $this;
61
    }
62
63
    /**
64
     * @return int
65
     */
66
    public function getPolicyId()
67
    {
68
        return $this->policyId;
69
    }
70
71
    /**
72
     * @param int $resource
73
     *
74
     * @return PolicyEntity
75
     */
76
    public function setResourceId($resource)
77
    {
78
        $this->resourceId = $resource;
79
80
        return $this;
81
    }
82
83
    /**
84
     * @return int
85
     */
86
    public function getResourceId()
87
    {
88
        return $this->resourceId;
89
    }
90
91
    /**
92
     * @param int $applicationId
93
     *
94
     * @return PolicyEntity
95
     */
96
    public function setApplicationId($applicationId)
97
    {
98
        $this->applicationId = $applicationId;
99
100
        return $this;
101
    }
102
103
    /**
104
     * @return int
105
     */
106
    public function getApplicationId()
107
    {
108
        return $this->applicationId;
109
    }
110
111
    /**
112
     * @param string $title
113
     *
114
     * @return PolicyEntity
115
     */
116
    public function setTitle($title)
117
    {
118
        $this->title = $title;
119
120
        return $this;
121
    }
122
123
    /**
124
     * @return string
125
     */
126
    public function getTitle()
127
    {
128
        return $this->title;
129
    }
130
131
    /**
132
     * @param string $description
133
     *
134
     * @return PolicyEntity
135
     */
136
    public function setDescription($description)
137
    {
138
        $this->description = $description;
139
140
        return $this;
141
    }
142
143
    /**
144
     * @return string
145
     */
146
    public function getDescription()
147
    {
148
        return $this->description;
149
    }
150
151
    /**
152
     * @param bool $state
153
     *
154
     * @return PolicyEntity
155
     */
156
    public function setReadOnly($state)
157
    {
158
        $this->isReadOnly = (bool) $state;
159
160
        return $this;
161
    }
162
163
    /**
164
     * @return bool
165
     */
166
    public function getReadOnly()
167
    {
168
        return $this->isReadOnly;
169
    }
170
171
    /**
172
     * @param bool $state
173
     *
174
     * @return PolicyEntity
175
     */
176
    public function setAllowed($state)
177
    {
178
        $this->isAllowed = (bool) $state;
179
180
        return $this;
181
    }
182
183
    /**
184
     * @return bool
185
     */
186
    public function getAllowed()
187
    {
188
        return $this->isAllowed;
189
    }
190
191
    /**
192
     * @param DateTime $dateCreated
193
     *
194
     * @return PolicyEntity
195
     */
196
    public function setDateCreated(DateTime $dateCreated)
197
    {
198
        $this->dateCreated = $dateCreated;
199
200
        return $this;
201
    }
202
203
    /**
204
     * @return DateTime
205
     */
206
    public function getDateCreated()
207
    {
208
        return $this->dateCreated;
209
    }
210
211
    /**
212
     * @param DateTime $dateModified
213
     *
214
     * @return PolicyEntity
215
     */
216
    public function setDateModified(DateTime $dateModified)
217
    {
218
        $this->dateModified = $dateModified;
219
220
        return $this;
221
    }
222
223
    /**
224
     * @return DateTime
225
     */
226
    public function getDateModified()
227
    {
228
        return $this->dateModified;
229
    }
230
}
231