Passed
Push — master ( 617109...d15981 )
by Gabor
04:00
created

ApplicationEntity::setEnabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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