Completed
Push — master ( 971421...d8f9fb )
by Matthew
09:04
created

BaseJob   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 182
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 182
ccs 12
cts 12
cp 1
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getRunId() 0 4 1
A setRunId() 0 4 1
A setArgs() 0 5 1
A getArgs() 0 6 1
1
<?php
2
3
namespace Dtc\QueueBundle\Entity;
4
5
use Dtc\GridBundle\Annotation as Grid;
6
use Doctrine\ORM\Mapping as ORM;
7
8
abstract class BaseJob extends \Dtc\QueueBundle\Model\RetryableJob
9
{
10
    /**
11
     * @Grid\Column(order=1,sortable=true,searchable=true)
12
     * @ORM\Column(type="bigint")
13
     * @ORM\Id
14
     * @ORM\GeneratedValue(strategy="AUTO")
15
     */
16
    protected $id;
17
18
    /**
19
     * @Grid\Column(sortable=true, searchable=true)
20
     * @ORM\Column(type="string")
21
     */
22
    protected $workerName;
23
24
    /**
25
     * @Grid\Column(sortable=true, searchable=true)
26
     * @ORM\Column(type="string")
27
     */
28
    protected $className;
29
30
    /**
31
     * @Grid\Column(sortable=true, searchable=true)
32
     * @ORM\Column(type="string")
33
     */
34
    protected $method;
35
36
    /**
37
     * @Grid\Column(sortable=true, searchable=true)
38
     * @ORM\Column(type="string")
39
     */
40
    protected $status;
41
42
    /**
43
     * @ORM\Column(type="text")
44
     */
45
    protected $args;
46
47
    /**
48
     * @ORM\Column(type="boolean", nullable=true)
49
     */
50
    protected $batch;
51
52
    /**
53
     * @Grid\Column(sortable=true, searchable=true)
54
     * @ORM\Column(type="boolean", nullable=true)
55
     */
56
    protected $locked;
57
58
    /**
59
     * @ORM\Column(type="datetime", nullable=true)
60
     */
61
    protected $lockedAt;
62
63
    /**
64
     * @Grid\Column(sortable=true,searchable=true)
65
     * @ORM\Column(type="integer", nullable=true)
66
     */
67
    protected $priority;
68
69
    /**
70
     * @ORM\Column(type="string")
71
     */
72
    protected $crcHash;
73
74
    /**
75
     * @Grid\Column(sortable=true,order=2)
76
     * @ORM\Column(type="datetime", nullable=true)
77
     */
78
    protected $whenAt;
79
80
    /**
81
     * @Grid\Column(sortable=true)
82
     * @ORM\Column(type="datetime", nullable=true)
83
     */
84
    protected $expiresAt;
85
86
    /**
87
     * When the job started.
88
     *
89
     * @Grid\Column(sortable=true)
90
     * @ORM\Column(type="datetime", nullable=true)
91
     */
92
    protected $startedAt;
93
94
    /**
95
     * When the job finished.
96
     *
97
     * @ORM\Column(type="datetime", nullable=true)
98
     */
99
    protected $finishedAt;
100
101
    /**
102
     * @ORM\Column(type="float", nullable=true)
103
     */
104
    protected $elapsed;
105
106
    /**
107
     * @ORM\Column(type="text", nullable=true)
108
     */
109
    protected $message;
110
111
    /**
112
     * @ORM\Column(type="datetime")
113
     */
114
    protected $createdAt;
115
116
    /**
117
     * @ORM\Column(type="datetime")
118
     */
119
    protected $updatedAt;
120
121
    /**
122
     * @ORM\Column(type="integer", nullable=true)
123
     */
124
    protected $maxDuration;
125
126
    /**
127
     * @ORM\Column(type="bigint", nullable=true)
128
     */
129
    protected $runId;
130
131
    /**
132
     * @ORM\Column(type="integer")
133
     */
134
    protected $stalledCount = 0;
135
136
    /**
137
     * @ORM\Column(type="integer", nullable=true)
138
     */
139
    protected $maxStalled;
140
141
    /**
142
     * @ORM\Column(type="integer")
143
     */
144
    protected $errorCount = 0;
145
146
    /**
147
     * @ORM\Column(type="integer", nullable=true)
148
     */
149
    protected $maxError;
150
151
    /**
152
     * @ORM\Column(type="integer")
153
     */
154
    protected $retries = 0;
155
156
    /**
157
     * @ORM\Column(type="integer", nullable=true)
158
     */
159
    protected $maxRetries;
160
161
    /**
162
     * @return mixed
163
     */
164 3
    public function getRunId()
165
    {
166 3
        return $this->runId;
167
    }
168
169
    /**
170
     * @param mixed $runId
171
     */
172 2
    public function setRunId($runId)
173
    {
174 2
        $this->runId = $runId;
175 2
    }
176
177 5
    public function setArgs($args)
178
    {
179 5
        $args = serialize($args);
180 5
        parent::setArgs($args);
181 5
    }
182
183 5
    public function getArgs()
184
    {
185 5
        $args = parent::getArgs();
186
187 5
        return unserialize($args);
188
    }
189
}
190