Completed
Pull Request — master (#1)
by Jim
08:57
created

TaskEvent::getFailedAt()   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
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
4
namespace Jarobe\TaskRunner\Entity;
5
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Table(name="task_event")
10
 * @ORM\Entity()
11
 */
12
class TaskEvent
13
{
14
    /**
15
     * @var integer
16
     *
17
     * @ORM\Column(name="id", type="integer")
18
     * @ORM\Id
19
     * @ORM\GeneratedValue(strategy="AUTO")
20
     */
21
    private $id;
22
23
    /**
24
     * @var string
25
     *
26
     * @ORM\Column(name="task_name", type="string", length=100)
27
     */
28
    private $taskName;
29
30
31
    /**
32
     * Many of the Tasks that are run have a specified time that they run for. Because of this, we store the TargetTime
33
     * outside of the payload. This helps significantly with querying what commands have been run for a date, as well.
34
     *
35
     * @var \DateTime
36
     *
37
     * @ORM\Column(name="target_time", type="datetime", nullable=true)
38
     */
39
    private $targetTime;
40
41
    /**
42
     * @var array
43
     *
44
     * @ORM\Column(name="payload", type="array")
45
     */
46
    private $payload;
47
48
    /**
49
     * @var \DateTime
50
     *
51
     * @ORM\Column(name="initiated_at", type="datetime", nullable=true)
52
     */
53
    private $initiatedAt;
54
55
    /**
56
     * @var \DateTime
57
     *
58
     * @ORM\Column(name="failed_at", type="datetime", nullable=true)
59
     */
60
    private $failedAt;
61
62
    /**
63
     * @var \DateTime
64
     *
65
     * @ORM\Column(name="completed_at", type="datetime", nullable=true)
66
     */
67
    private $completedAt;
68
69
    /**
70
     * @var array
71
     *
72
     * @ORM\Column(name="errors", type="json_array", nullable=true)
73
     */
74
    private $errors;
75
76
    /**
77
     * @return int
78
     */
79
    public function getId()
80
    {
81
        return $this->id;
82
    }
83
84
    /**
85
     * @return string
86
     */
87
    public function getTaskName()
88
    {
89
        return $this->taskName;
90
    }
91
92
    /**
93
     * @param string $taskName
94
     * @return TaskEvent
95
     */
96
    public function setTaskName($taskName)
97
    {
98
        $this->taskName = $taskName;
99
        return $this;
100
    }
101
102
    /**
103
     * @return array
104
     */
105
    public function getPayload()
106
    {
107
        return $this->payload;
108
    }
109
110
    /**
111
     * @param array $payload
112
     * @return TaskEvent
113
     */
114
    public function setPayload($payload)
115
    {
116
        $this->payload = $payload;
117
        return $this;
118
    }
119
120
    /**
121
     * @return \DateTime
122
     */
123
    public function getInitiatedAt()
124
    {
125
        return $this->initiatedAt;
126
    }
127
128
    /**
129
     * @param \DateTime $initiatedAt
130
     * @return TaskEvent
131
     */
132
    public function setInitiatedAt($initiatedAt)
133
    {
134
        $this->initiatedAt = $initiatedAt;
135
        return $this;
136
    }
137
138
    /**
139
     * @return \DateTime
140
     */
141
    public function getCompletedAt()
142
    {
143
        return $this->completedAt;
144
    }
145
146
    /**
147
     * @param \DateTime $completedAt
148
     * @return TaskEvent
149
     */
150
    public function setCompletedAt($completedAt)
151
    {
152
        $this->completedAt = $completedAt;
153
        return $this;
154
    }
155
156
    /**
157
     * @return \DateTime
158
     */
159
    public function getFailedAt()
160
    {
161
        return $this->failedAt;
162
    }
163
164
    /**
165
     * @param $failedAt
166
     * @return $this
167
     */
168
    public function setFailedAt($failedAt)
169
    {
170
        $this->failedAt = $failedAt;
171
        return $this;
172
    }
173
174
    /**
175
     * @return array
176
     */
177
    public function getErrors()
178
    {
179
        return $this->errors;
180
    }
181
182
    /**
183
     * @param $errors
184
     * @return $this
185
     */
186
    public function setErrors($errors)
187
    {
188
        $this->errors = $errors;
189
190
        return $this;
191
    }
192
193
    /**
194
     * @return \DateTime
195
     */
196
    public function getTargetTime()
197
    {
198
        return $this->targetTime;
199
    }
200
201
    /**
202
     * @param \DateTime $targetTime
203
     * @return $this
204
     */
205
    public function setTargetTime($targetTime)
206
    {
207
        $this->targetTime = $targetTime;
208
209
        return $this;
210
    }
211
}
212