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

ResourceEntity::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 6
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
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 ResourceEntity.
19
 */
20 View Code Duplication
class ResourceEntity implements DataEntityInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

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