1 | <?php namespace Comodojo\Extender\Orm\Entities; |
||
26 | class Worklog { |
||
27 | |||
28 | const STATUS_RUNNING = 0; |
||
29 | |||
30 | const STATUS_ERROR = 1; |
||
31 | |||
32 | const STATUS_FINISHED = 2; |
||
33 | |||
34 | const STATUS_ABORTED = 3; |
||
35 | |||
36 | use BaseEntityTrait; |
||
37 | |||
38 | /** |
||
39 | * @var integer |
||
40 | * |
||
41 | * @ORM\Column(name="pid", type="integer", nullable=false) |
||
42 | */ |
||
43 | protected $pid; |
||
44 | |||
45 | /** |
||
46 | * @var integer |
||
47 | * |
||
48 | * @ORM\ManyToOne(targetEntity="Schedule", cascade={"persist"}) |
||
49 | * @ORM\JoinColumn(name="jid", nullable=true, referencedColumnName="id", onDelete="SET NULL") |
||
50 | */ |
||
51 | protected $jid; |
||
52 | |||
53 | /** |
||
54 | * @var integer |
||
55 | * |
||
56 | * @ORM\Column(name="status", type="integer", nullable=false) |
||
57 | */ |
||
58 | protected $status; |
||
59 | |||
60 | /** |
||
61 | * @var boolean |
||
62 | * |
||
63 | * @ORM\Column(name="success", type="boolean", nullable=true) |
||
64 | */ |
||
65 | protected $success; |
||
66 | |||
67 | /** |
||
68 | * @var string |
||
69 | * |
||
70 | * @ORM\Column(name="result", type="text", length=65535, nullable=true) |
||
71 | */ |
||
72 | protected $result; |
||
73 | |||
74 | /** |
||
75 | * @var datetime |
||
76 | * |
||
77 | * @ORM\Column(name="start", type="datetime", nullable=false) |
||
78 | */ |
||
79 | protected $start_time; |
||
80 | |||
81 | /** |
||
82 | * @var datetime |
||
83 | * |
||
84 | * @ORM\Column(name="end", type="datetime", nullable=true) |
||
85 | */ |
||
86 | protected $end_time; |
||
87 | |||
88 | /** |
||
89 | * Get worklog item's pid |
||
90 | * |
||
91 | * @return integer |
||
92 | */ |
||
93 | public function getPid() { |
||
98 | |||
99 | /** |
||
100 | * Set worklog item's pid |
||
101 | * |
||
102 | * @param string $pid |
||
103 | * @return Worklog |
||
104 | */ |
||
105 | public function setPid($pid) { |
||
112 | |||
113 | /** |
||
114 | * Get worklog item's jid |
||
115 | * |
||
116 | * @return integer |
||
117 | */ |
||
118 | public function getJid() { |
||
123 | |||
124 | /** |
||
125 | * Set worklog item's jid |
||
126 | * |
||
127 | * @param string $jid |
||
128 | * @return Worklog |
||
129 | */ |
||
130 | public function setJid($jid) { |
||
137 | |||
138 | /** |
||
139 | * Get current job status |
||
140 | * |
||
141 | * @return int |
||
142 | */ |
||
143 | public function getStatus() { |
||
148 | |||
149 | /** |
||
150 | * Set current job status |
||
151 | * |
||
152 | * @param string $name |
||
153 | * @return Worklog |
||
154 | */ |
||
155 | public function setStatus($status) { |
||
164 | |||
165 | /** |
||
166 | * True if task is finished with success state |
||
167 | * |
||
168 | * @return bool |
||
169 | */ |
||
170 | public function getSuccess() { |
||
175 | |||
176 | /** |
||
177 | * Set task exit status |
||
178 | * |
||
179 | * @param bool $success |
||
180 | * @return Worklog |
||
181 | */ |
||
182 | public function setSuccess($success) { |
||
191 | |||
192 | /** |
||
193 | * Get the task's result |
||
194 | * |
||
195 | * @return string |
||
196 | */ |
||
197 | public function getResult() { |
||
202 | |||
203 | /** |
||
204 | * Set the task's result |
||
205 | * |
||
206 | * @param string $result |
||
207 | * @return Worklog |
||
208 | */ |
||
209 | public function setResult($result) { |
||
216 | |||
217 | /** |
||
218 | * Get the task's start-time |
||
219 | * |
||
220 | * @return DateTime |
||
221 | */ |
||
222 | public function getStartTime() { |
||
227 | |||
228 | /** |
||
229 | * Set the task's start-time |
||
230 | * |
||
231 | * @param DateTime $datetime |
||
232 | * @return Worklog |
||
233 | */ |
||
234 | public function setStartTime(DateTime $datetime) { |
||
241 | |||
242 | /** |
||
243 | * Get the task's end-time |
||
244 | * |
||
245 | * @return DateTime |
||
246 | */ |
||
247 | public function getEndTime() { |
||
252 | |||
253 | /** |
||
254 | * Set the task's end-time |
||
255 | * |
||
256 | * @param DateTime $datetime |
||
257 | * @return Worklog |
||
258 | */ |
||
259 | public function setEndTime(DateTime $datetime) { |
||
266 | |||
267 | } |
||
268 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.