Passed
Push — master ( bf0ee3...0945b6 )
by FX
02:34
created

Project::getRefId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * Copyright (c) 2017 Francois-Xavier Soubirou.
4
 *
5
 * This file is part of ci-report.
6
 *
7
 * ci-report is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation, either version 3 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * ci-report is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with ci-report. If not, see <http://www.gnu.org/licenses/>.
19
 */
20
declare(strict_types=1);
21
22
namespace AppBundle\Entity;
23
24
use Doctrine\ORM\Mapping as ORM;
25
use JMS\Serializer\Annotation as Serializer;
26
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
27
use Symfony\Component\Validator\Constraints as Assert;
28
29
/**
30
 * Project entity class.
31
 *
32
 * @category  ci-report app
33
 *
34
 * @author    Francois-Xavier Soubirou <[email protected]>
35
 * @copyright 2017 Francois-Xavier Soubirou
36
 * @license   http://www.gnu.org/licenses/   GPLv3
37
 *
38
 * @see      https://ci-report.io
39
 *
40
 * @ORM\Table(name="cir_project")
41
 * @ORM\Entity(repositoryClass="AppBundle\Repository\ProjectRepository")
42
 *
43
 * @UniqueEntity("name")
44
 *
45
 * @Serializer\ExclusionPolicy("ALL")
46
 */
47
class Project
48
{
49
    const DEFAULT_WARNING_LIMIT = 80;
50
    const DEFAULT_SUCCESS_LIMIT = 95;
51
52
    /**
53
     * @var int
54
     *
55
     * @ORM\Column(name="id", type="integer")
56
     * @ORM\Id
57
     * @ORM\GeneratedValue(strategy="AUTO")
58
     */
59
    private $id;
60
61
    /**
62
     * @var string
63
     *
64
     * @ORM\Column(name="name", type="string", length=50, unique=true)
65
     *
66
     * @Assert\NotBlank
67
     *
68
     * @Serializer\Expose
69
     */
70
    private $name;
71
72
    /**
73
     * @var string
74
     *
75
     * @ORM\Column(name="refid", type="string", length=50, unique=true)
76
     *
77
     * @Serializer\Expose
78
     */
79
    private $refId;
80
81
    /**
82
     * @var int
83
     *
84
     * @ORM\Column(name="warning_limit", type="smallint")
85
     *
86
     * @Serializer\Expose
87
     */
88
    private $warningLimit;
89
90
    /**
91
     * @var int
92
     *
93
     * @ORM\Column(name="success_limit", type="smallint")
94
     *
95
     * @Serializer\Expose
96
     */
97
    private $successLimit;
98
99
    /**
100
     * Constructor.
101
     */
102
    public function __construct()
103
    {
104
        $this->setWarningLimit(self::DEFAULT_WARNING_LIMIT);
105
        $this->setSuccessLimit(self::DEFAULT_SUCCESS_LIMIT);
106
    }
107
108
    /**
109
     * Get id.
110
     *
111
     * @return int
112
     */
113
    public function getId(): int
114
    {
115
        return $this->id;
116
    }
117
118
    /**
119
     * Set name.
120
     *
121
     * @param string $name
122
     *
123
     * @return Project
124
     */
125
    public function setName(string $name): Project
126
    {
127
        $this->name = $name;
128
129
        return $this;
130
    }
131
132
    /**
133
     * Get name.
134
     *
135
     * @return string
136
     */
137
    public function getName(): string
138
    {
139
        return $this->name;
140
    }
141
142
    /**
143
     * Set refId.
144
     *
145
     * @param string $refId
146
     *
147
     * @return Project
148
     */
149
    public function setRefId(string $refId): Project
150
    {
151
        $this->refId = $refId;
152
153
        return $this;
154
    }
155
156
    /**
157
     * Get refId.
158
     *
159
     * @return string
160
     */
161
    public function getRefId(): string
162
    {
163
        return $this->refId;
164
    }
165
166
    /**
167
     * Set warning limit.
168
     *
169
     * @param int $warningLimit
170
     *
171
     * @return Project
172
     */
173
    public function setWarningLimit(int $warningLimit): Project
174
    {
175
        $this->warningLimit = $warningLimit;
176
177
        return $this;
178
    }
179
180
    /**
181
     * Get warning limit.
182
     *
183
     * @return int
184
     */
185
    public function getWarningLimit(): ?int
186
    {
187
        return $this->warningLimit;
188
    }
189
190
    /**
191
     * Set success limit.
192
     *
193
     * @param int $successLimit
194
     *
195
     * @return Project
196
     */
197
    public function setSuccessLimit(int $successLimit): Project
198
    {
199
        $this->successLimit = $successLimit;
200
201
        return $this;
202
    }
203
204
    /**
205
     * Get success limit.
206
     *
207
     * @return int
208
     */
209
    public function getSuccessLimit(): ?int
210
    {
211
        return $this->successLimit;
212
    }
213
}
214