Test Failed
Push — master ( faf208...51c6fd )
by Martin
14:25
created

Task::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Todo\Domain;
4
5
/**
6
 * Class Task
7
 *
8
 * @category None
9
 * @package  Domain\Model
10
 * @author   Martin Pham <[email protected]>
11
 * @license  None http://
12
 * @link     None
13
 */
14
class Task implements \JsonSerializable
15
{
16
17
    const STATUS_REMAINING = 'remaining';
18
    const STATUS_COMPLETED = 'completed';
19
20
    protected $id;
21
    protected $name;
22
    protected $status = Task::STATUS_REMAINING;
23
    protected $createdAt;
24
    protected $updatedAt;
25
26
    /**
27
     * Get Id
28
     *
29
     * @return mixed
30
     */
31
    public function getId()
32
    {
33
        return $this->id;
34
    }
35
36
    /**
37
     * Set Id
38
     *
39
     * @param mixed $id Id
40
     */
41
    public function setId($id)
42
    {
43
        $this->id = $id;
44
    }
45
46
    /**
47
     * Get Name
48
     *
49
     * @return mixed
50
     */
51
    public function getName()
52
    {
53
        return $this->name;
54
    }
55
56
    /**
57
     * Set Name
58
     *
59
     * @param mixed $name Name
60
     */
61
    public function setName($name)
62
    {
63
        $this->name = $name;
64
    }
65
66
    /**
67
     * Get Status
68
     *
69
     * @return mixed
70
     */
71
    public function getStatus()
72
    {
73
        return $this->status;
74
    }
75
76
    /**
77
     * Set Status
78
     *
79
     * @param mixed $status Status
80
     */
81
    public function setStatus($status)
82
    {
83
        $this->status = $status;
84
    }
85
86
    /**
87
     * Get CreatedAt
88
     *
89
     * @return mixed
90
     */
91
    public function getCreatedAt()
92
    {
93
        return $this->createdAt;
94
    }
95
96
    /**
97
     * Set CreatedAt
98
     *
99
     * @param mixed $createdAt CreatedAt
100
     */
101
    public function setCreatedAt($createdAt)
102
    {
103
        $this->createdAt = $createdAt;
104
    }
105
106
    /**
107
     * Get UpdatedAt
108
     *
109
     * @return mixed
110
     */
111
    public function getUpdatedAt()
112
    {
113
        return $this->updatedAt;
114
    }
115
116
    /**
117
     * Set UpdatedAt
118
     *
119
     * @param mixed $updatedAt UpdatedAt
120
     */
121
    public function setUpdatedAt($updatedAt)
122
    {
123
        $this->updatedAt = $updatedAt;
124
    }
125
126
    /**
127
     * @inheritDoc
128
     */
129
    public function jsonSerialize()
130
    {
131
        return [
132
            'id' => $this->getId(),
133
            'name' => $this->getName(),
134
            'status' => $this->getStatus()
135
        ];
136
    }
137
}
138