1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Dtc\QueueBundle\Model; |
4
|
|
|
|
5
|
|
|
class RunManager |
6
|
|
|
{ |
7
|
|
|
/** @var string */ |
8
|
|
|
protected $runClass; |
9
|
|
|
|
10
|
|
|
/** @var string */ |
11
|
|
|
protected $jobTimingClass; |
12
|
|
|
|
13
|
|
|
/** @var bool */ |
14
|
|
|
protected $recordTimings; |
15
|
|
|
|
16
|
13 |
|
public function __construct($runClass, $jobTimingClass, $recordTimings) |
17
|
|
|
{ |
18
|
13 |
|
$this->runClass = $runClass; |
19
|
13 |
|
$this->jobTimingClass = $jobTimingClass; |
20
|
13 |
|
$this->recordTimings = $recordTimings; |
21
|
13 |
|
} |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @return string |
25
|
|
|
*/ |
26
|
3 |
|
public function getRunClass() |
27
|
|
|
{ |
28
|
3 |
|
return $this->runClass; |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @param string $runClass |
33
|
|
|
*/ |
34
|
|
|
public function setRunClass($runClass) |
35
|
|
|
{ |
36
|
|
|
$this->runClass = $runClass; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @param \DateTime $olderThan |
41
|
|
|
* |
42
|
|
|
* @return int Number of archived runs pruned |
43
|
|
|
*/ |
44
|
|
|
public function pruneArchivedRuns(\DateTime $olderThan) |
45
|
|
|
{ |
46
|
|
|
throw new \Exception('not supported'); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @param \DateTime $olderThan |
51
|
|
|
* |
52
|
|
|
* @return int Number of archived runs pruned |
53
|
|
|
*/ |
54
|
|
|
public function pruneJobTimings(\DateTime $olderThan) |
55
|
|
|
{ |
56
|
|
|
throw new \Exception('not supported'); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function pruneStalledRuns() |
60
|
|
|
{ |
61
|
|
|
throw new \Exception('not supported'); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @return null|string |
66
|
|
|
*/ |
67
|
|
|
public function getJobTimingClass() |
68
|
|
|
{ |
69
|
|
|
return $this->jobTimingClass; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @param string $jobTimingClass |
74
|
|
|
*/ |
75
|
3 |
|
public function setJobTimingClass($jobTimingClass) |
76
|
|
|
{ |
77
|
3 |
|
$this->jobTimingClass = $jobTimingClass; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
public function recordJobRun(Job $job) |
81
|
|
|
{ |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|