1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of HeriJobQueueBundle. |
5
|
|
|
* |
6
|
|
|
* (c) Alexandre Mogère |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the MIT license that is bundled |
9
|
|
|
* with this source code in the file LICENSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Heri\Bundle\JobQueueBundle\Entity; |
13
|
|
|
|
14
|
|
|
use Doctrine\ORM\Mapping as ORM; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Heri\Bundle\JobQueueBundle\Entity\Queue. |
18
|
|
|
* |
19
|
|
|
* @ORM\Table(name="queue") |
20
|
|
|
* @ORM\Entity |
21
|
|
|
*/ |
22
|
|
|
class Queue |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* @var int |
26
|
|
|
* |
27
|
|
|
* @ORM\Column(name="id", type="integer", nullable=false) |
28
|
|
|
* @ORM\Id |
29
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
30
|
|
|
*/ |
31
|
|
|
private $id; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string |
35
|
|
|
* |
36
|
|
|
* @ORM\Column(name="name", type="string", length=100, nullable=false) |
37
|
|
|
*/ |
38
|
|
|
private $name; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var smallint |
42
|
|
|
* |
43
|
|
|
* @ORM\Column(name="timeout", type="smallint", nullable=false) |
44
|
|
|
*/ |
45
|
|
|
private $timeout; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var int |
49
|
|
|
* |
50
|
|
|
* @ORM\Column(name="max_retries", type="integer", nullable=true) |
51
|
|
|
*/ |
52
|
|
|
private $maxRetries = null; |
53
|
|
|
|
54
|
|
|
public function __toString() |
55
|
|
|
{ |
56
|
|
|
return $this->name; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Get id. |
61
|
|
|
* |
62
|
|
|
* @return int |
63
|
|
|
*/ |
64
|
|
|
public function getId() |
65
|
|
|
{ |
66
|
|
|
return $this->id; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* Set name. |
71
|
|
|
* |
72
|
|
|
* @param string $name |
73
|
|
|
*/ |
74
|
|
|
public function setName($name) |
75
|
|
|
{ |
76
|
|
|
$this->name = $name; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Get name. |
81
|
|
|
* |
82
|
|
|
* @return string |
83
|
|
|
*/ |
84
|
|
|
public function getName() |
85
|
|
|
{ |
86
|
|
|
return $this->name; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Set timeout. |
91
|
|
|
* |
92
|
|
|
* @param smallint $timeout |
93
|
|
|
*/ |
94
|
|
|
public function setTimeout($timeout) |
95
|
|
|
{ |
96
|
|
|
$this->timeout = $timeout; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Get timeout. |
101
|
|
|
* |
102
|
|
|
* @return smallint |
103
|
|
|
*/ |
104
|
|
|
public function getTimeout() |
105
|
|
|
{ |
106
|
|
|
return $this->timeout; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @return int |
111
|
|
|
*/ |
112
|
|
|
public function getMaxRetries() |
113
|
|
|
{ |
114
|
|
|
return $this->maxRetries; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @param int $maxRetries |
119
|
|
|
*/ |
120
|
|
|
public function setMaxRetries($maxRetries) |
121
|
|
|
{ |
122
|
|
|
$this->maxRetries = $maxRetries; |
123
|
|
|
} |
124
|
|
|
} |
125
|
|
|
|