Task::setDateUpdated()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Symfony\Component\Validator\Constraints as Assert;
7
use DateTime;
8
9
/**
10
 * Task
11
 *
12
 * @ORM\Table(name="task")
13
 * @ORM\Entity(repositoryClass="AppBundle\Repository\TaskRepository")
14
 */
15
class Task
16
{
17
    const STATUS_NEW = 'new';
18
    const STATUS_COMPLETED = 'completed';
19
    const STATUS_IN_PROGRESS = 'in_progress';
20
21
    const PRIORITY_LOW = 1;
22
    const PRIORITY_NORMAL = 2;
23
    const PRIORITY_HIGH = 3;
24
25
    /**
26
     * @var int
27
     *
28
     * @ORM\Column(name="id", type="integer")
29
     * @ORM\Id
30
     * @ORM\GeneratedValue(strategy="AUTO")
31
     */
32
    private $id;
33
34
    /**
35
     * @var string
36
     *
37
     * @Assert\NotBlank()
38
     * @ORM\Column(name="title", type="string", length=255)
39
     */
40
    private $title;
41
42
    /**
43
     * @var \DateTime
44
     *
45
     * @ORM\Column(name="dateCreated", type="datetime")
46
     */
47
    private $dateCreated;
48
49
    /**
50
     * @var \DateTime
51
     *
52
     * @ORM\Column(name="dateUpdated", type="datetime", nullable=true)
53
     */
54
    private $dateUpdated;
55
56
    /**
57
     * @var string
58
     *
59
     * @Assert\NotBlank()
60
     * @ORM\Column(name="description", type="text", nullable=true)
61
     */
62
    private $description;
63
64
    /**
65
     * @var string
66
     *
67
     * @ORM\Column(name="status", type="string", length=20)
68
     */
69
    private $status;
70
71
    /**
72
     * @var int
73
     *
74
     * @ORM\Column(name="priority", type="integer")
75
     */
76
    private $priority;
77
78
    public function __construct()
79
    {
80
        $this->dateCreated = new DateTime();
81
        $this->status = static::STATUS_NEW;
82
        $this->priority = 0;
83
    }
84
85
    /**
86
     * Get id
87
     *
88
     * @return int
89
     */
90
    public function getId()
91
    {
92
        return $this->id;
93
    }
94
95
    /**
96
     * Set title
97
     *
98
     * @param string $title
99
     *
100
     * @return Task
101
     */
102
    public function setTitle($title)
103
    {
104
        $this->title = $title;
105
106
        return $this;
107
    }
108
109
    /**
110
     * Get title
111
     *
112
     * @return string
113
     */
114
    public function getTitle()
115
    {
116
        return $this->title;
117
    }
118
119
    /**
120
     * Set dateCreated
121
     *
122
     * @param \DateTime $dateCreated
123
     *
124
     * @return Task
125
     */
126
    public function setDateCreated($dateCreated)
127
    {
128
        $this->dateCreated = $dateCreated;
129
130
        return $this;
131
    }
132
133
    /**
134
     * Get dateCreated
135
     *
136
     * @return \DateTime
137
     */
138
    public function getDateCreated()
139
    {
140
        return $this->dateCreated;
141
    }
142
143
    /**
144
     * Set dateUpdated
145
     *
146
     * @param \DateTime $dateUpdated
147
     *
148
     * @return Task
149
     */
150
    public function setDateUpdated($dateUpdated)
151
    {
152
        $this->dateUpdated = $dateUpdated;
153
154
        return $this;
155
    }
156
157
    /**
158
     * Get dateUpdated
159
     *
160
     * @return \DateTime
161
     */
162
    public function getDateUpdated()
163
    {
164
        return $this->dateUpdated;
165
    }
166
167
    /**
168
     * Set description
169
     *
170
     * @param string $description
171
     *
172
     * @return Task
173
     */
174
    public function setDescription($description)
175
    {
176
        $this->description = $description;
177
178
        return $this;
179
    }
180
181
    /**
182
     * Get description
183
     *
184
     * @return string
185
     */
186
    public function getDescription()
187
    {
188
        return $this->description;
189
    }
190
191
    /**
192
     * Set status
193
     *
194
     * @param string $status
195
     *
196
     * @return Task
197
     */
198
    public function setStatus($status)
199
    {
200
        $this->status = $status;
201
202
        return $this;
203
    }
204
205
    /**
206
     * Get status
207
     *
208
     * @return string
209
     */
210
    public function getStatus()
211
    {
212
        return $this->status;
213
    }
214
215
    /**
216
     * Set priority
217
     *
218
     * @param integer $priority
219
     *
220
     * @return Task
221
     */
222
    public function setPriority($priority)
223
    {
224
        $this->priority = $priority;
225
226
        return $this;
227
    }
228
229
    /**
230
     * Get priority
231
     *
232
     * @return int
233
     */
234
    public function getPriority()
235
    {
236
        return $this->priority;
237
    }
238
}
239