Passed
Push — master ( 97f73d...f32c79 )
by Gabor
08:10
created

ResourceEntity::getDateModified()   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 7.1
6
 *
7
 * @copyright 2012 - 2017 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
declare(strict_types = 1);
13
14
namespace WebHemi\Data\Entity\AccessManagement;
15
16
use WebHemi\DateTime;
17
use WebHemi\Data\Entity\DataEntityInterface;
18
19
/**
20
 * Class ResourceEntity.
21
 */
22
class ResourceEntity implements DataEntityInterface
23
{
24
    /** @var int */
25
    private $resourceId;
26
    /** @var string */
27
    private $name;
28
    /** @var string */
29
    private $title;
30
    /** @var string */
31
    private $description;
32
    /** @var bool */
33
    private $isReadOnly;
34
    /** @var DateTime */
35
    private $dateCreated;
36
    /** @var DateTime */
37
    private $dateModified;
38
39
    /**
40
     * Sets the value of the entity identifier.
41
     *
42
     * @param int $entityId
43
     * @return ResourceEntity
44
     */
45 1
    public function setKeyData(int $entityId) : ResourceEntity
46
    {
47 1
        $this->resourceId = $entityId;
48
49 1
        return $this;
50
    }
51
52
    /**
53
     * Gets the value of the entity identifier.
54
     *
55
     * @return null|int
56
     */
57 3
    public function getKeyData() : ? int
58
    {
59 3
        return $this->resourceId;
60
    }
61
62
    /**
63
     * @param int $resourceId
64
     * @return ResourceEntity
65
     */
66 5
    public function setResourceId(int $resourceId) : ResourceEntity
67
    {
68 5
        $this->resourceId = $resourceId;
69
70 5
        return $this;
71
    }
72
73
    /**
74
     * @return null|int
75
     */
76 2
    public function getResourceId() : ? int
77
    {
78 2
        return $this->resourceId;
79
    }
80
81
    /**
82
     * @param string $name
83
     * @return ResourceEntity
84
     */
85 4
    public function setName(string $name) : ResourceEntity
86
    {
87 4
        $this->name = $name;
88
89 4
        return $this;
90
    }
91
92
    /**
93
     * @return null|string
94
     */
95 3
    public function getName() : ? string
96
    {
97 3
        return $this->name;
98
    }
99
100
    /**
101
     * @param string $title
102
     * @return ResourceEntity
103
     */
104 4
    public function setTitle(string $title) : ResourceEntity
105
    {
106 4
        $this->title = $title;
107
108 4
        return $this;
109
    }
110
111
    /**
112
     * @return null|string
113
     */
114 3
    public function getTitle() : ? string
115
    {
116 3
        return $this->title;
117
    }
118
119
    /**
120
     * @param string $description
121
     * @return ResourceEntity
122
     */
123 4
    public function setDescription(string $description) : ResourceEntity
124
    {
125 4
        $this->description = $description;
126
127 4
        return $this;
128
    }
129
130
    /**
131
     * @return null|string
132
     */
133 3
    public function getDescription() : ? string
134
    {
135 3
        return $this->description;
136
    }
137
138
    /**
139
     * @param bool $state
140
     * @return ResourceEntity
141
     */
142 4
    public function setReadOnly(bool $state) : ResourceEntity
143
    {
144 4
        $this->isReadOnly = $state;
145
146 4
        return $this;
147
    }
148
149
    /**
150
     * @return bool
151
     */
152 3
    public function getReadOnly() : bool
153
    {
154 3
        return $this->isReadOnly ?? false;
155
    }
156
157
    /**
158
     * @param DateTime $dateCreated
159
     * @return ResourceEntity
160
     */
161 4
    public function setDateCreated(DateTime $dateCreated) : ResourceEntity
162
    {
163 4
        $this->dateCreated = $dateCreated;
164
165 4
        return $this;
166
    }
167
168
    /**
169
     * @return null|DateTime
170
     */
171 3
    public function getDateCreated() : ? DateTime
172
    {
173 3
        return $this->dateCreated;
174
    }
175
176
    /**
177
     * @param DateTime $dateModified
178
     * @return ResourceEntity
179
     */
180 4
    public function setDateModified(DateTime $dateModified) : ResourceEntity
181
    {
182 4
        $this->dateModified = $dateModified;
183
184 4
        return $this;
185
    }
186
187
    /**
188
     * @return null|DateTime
189
     */
190 3
    public function getDateModified() : ? DateTime
191
    {
192 3
        return $this->dateModified;
193
    }
194
}
195