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

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