Completed
Push — master ( 2db41f...aa6ae6 )
by Matthew
15:06 queued 36s
created

JobTiming::getFinishedAt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Dtc\QueueBundle\Model;
4
5
class JobTiming
6
{
7
    const STATUS_INSERT = 0;
8
    const STATUS_INSERT_DELAYED = 1;
9
    const STATUS_FINISHED_SUCCESS = 100;
10
    const STATUS_FINISHED_ERROR = 101;
11
    const STATUS_FINISHED_EXPIRED = 102;
12
    const STATUS_FINISHED_STALLED = 103;
13
14
    protected $finishedAt;
15
    protected $status;
16
17
    /**
18
     * A list of all the states and descriptions for them.
19
     *
20
     * @return array
21
     */
22
    public static function getStates()
23
    {
24
        return [self::STATUS_FINISHED_SUCCESS => ['label' => 'Finished: SUCCESS', 'color' => 'green'],
25
            self::STATUS_FINISHED_ERROR => ['label' => 'Finished: ERROR', 'color' => 'red'],
26
            self::STATUS_FINISHED_EXPIRED => ['label' => 'Finished: EXPIRED', 'color' => 'orange'],
27
            self::STATUS_FINISHED_STALLED => ['label' => 'Finished: STALLED', 'color' => 'gold'],
28
            self::STATUS_INSERT => ['label' => 'INSERT', 'color' => 'purple'],
29
            self::STATUS_INSERT_DELAYED => ['label' => 'INSERT (Delayed)', 'color' => 'navy'], ];
30
    }
31
32
    /**
33
     * @return mixed
34
     */
35 3
    public function getFinishedAt()
36
    {
37 3
        return $this->finishedAt;
38
    }
39
40
    /**
41
     * @param mixed $finishedAt
42
     */
43 36
    public function setFinishedAt($finishedAt)
44
    {
45 36
        $this->finishedAt = $finishedAt;
46 36
    }
47
48
    /**
49
     * @return int
50
     */
51 3
    public function getStatus()
52
    {
53 3
        return $this->status;
54
    }
55
56
    /**
57
     * @param int $status
58
     */
59 36
    public function setStatus($status)
60
    {
61 36
        $this->status = $status;
62 36
    }
63
}
64