Completed
Push — master ( a454e0...d0194b )
by Matthew
07:25
created

Run::setLastHeartbeatAt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Dtc\QueueBundle\Model;
4
5
/**
6
 * Class QueueWorker.
7
 *
8
 * Placeholder for future Queue Worker that sits and drains the queue
9
 */
10
class Run
11
{
12
    protected $id;
13
    protected $startedAt;
14
    protected $endedAt;
15
    protected $elapsed;
16
    protected $duration; // How long to run for in seconds
17
    protected $lastHeartbeatAt;
18
    protected $maxCount;
19
    protected $processed; // Number of jobs processed
20
    protected $hostname;
21
    protected $pid;
22
    protected $processTimeout;
23
24
    /**
25
     * @return mixed
26
     */
27 15
    public function getId()
28
    {
29 15
        return $this->id;
30
    }
31
32
    /**
33
     * @param mixed $id
34
     */
35 14
    public function setId($id)
36
    {
37 14
        $this->id = $id;
38 14
    }
39
40
    /**
41
     * @return \DateTime|null
42
     */
43 9
    public function getStartedAt()
44
    {
45 9
        return $this->startedAt;
46
    }
47
48
    /**
49
     * @param \DateTime $startedAt
50
     */
51 6
    public function setStartedAt(\DateTime $startedAt)
52
    {
53 6
        $this->startedAt = $startedAt;
54 6
    }
55
56
    /**
57
     * @return \DateTime|null
58
     */
59 9
    public function getEndedAt()
60
    {
61 9
        return $this->endedAt;
62
    }
63
64
    /**
65
     * @param \DateTime $endedAt
66
     */
67 8
    public function setEndedAt(\DateTime $endedAt)
68
    {
69 8
        $this->endedAt = $endedAt;
70 8
    }
71
72
    /**
73
     * @return int
74
     */
75 14
    public function getDuration()
76
    {
77 14
        return $this->duration;
78
    }
79
80
    /**
81
     * @param int $duration
82
     */
83 7
    public function setDuration($duration)
84
    {
85 7
        $this->duration = $duration;
86 7
    }
87
88
    /**
89
     * @return \DateTime|null
90
     */
91 9
    public function getLastHeartbeatAt()
92
    {
93 9
        return $this->lastHeartbeatAt;
94
    }
95
96
    /**
97
     * @param \DateTime $lastHeartbeatAt
98
     */
99 9
    public function setLastHeartbeatAt(\DateTime $lastHeartbeatAt)
100
    {
101 9
        $this->lastHeartbeatAt = $lastHeartbeatAt;
102 9
    }
103
104
    /**
105
     * @return int
106
     */
107 14
    public function getMaxCount()
108
    {
109 14
        return $this->maxCount;
110
    }
111
112
    /**
113
     * @param int $maxCount
114
     */
115 8
    public function setMaxCount($maxCount)
116
    {
117 8
        $this->maxCount = $maxCount;
118 8
    }
119
120
    /**
121
     * @return int
122
     */
123 15
    public function getProcessed()
124
    {
125 15
        return $this->processed;
126
    }
127
128
    /**
129
     * @param int $processed
130
     */
131 11
    public function setProcessed($processed)
132
    {
133 11
        $this->processed = $processed;
134 11
    }
135
136
    /**
137
     * @return string|null
138
     */
139 15
    public function getHostname()
140
    {
141 15
        return $this->hostname;
142
    }
143
144
    /**
145
     * @param string $hostname
146
     */
147 8
    public function setHostname($hostname)
148
    {
149 8
        $this->hostname = $hostname;
150 8
    }
151
152
    /**
153
     * @return int|null
154
     */
155 14
    public function getPid()
156
    {
157 14
        return $this->pid;
158
    }
159
160
    /**
161
     * @param int $pid
162
     */
163 8
    public function setPid($pid)
164
    {
165 8
        $this->pid = $pid;
166 8
    }
167
168
    /**
169
     * @return mixed
170
     */
171 15
    public function getElapsed()
172
    {
173 15
        return $this->elapsed;
174
    }
175
176
    /**
177
     * @param mixed $elapsed
178
     */
179 8
    public function setElapsed($elapsed)
180
    {
181 8
        $this->elapsed = $elapsed;
182 8
    }
183
184
    /**
185
     * @return mixed
186
     */
187 14
    public function getProcessTimeout()
188
    {
189 14
        return $this->processTimeout;
190
    }
191
192
    /**
193
     * @param mixed $processTimeout
194
     */
195 8
    public function setProcessTimeout($processTimeout)
196
    {
197 8
        $this->processTimeout = $processTimeout;
198 8
    }
199
}
200