| @@ 238-250 (lines=13) @@ | ||
| 235 | ||
| 236 | } |
|
| 237 | ||
| 238 | public function shouldRunJob(DateTime $time) { |
|
| 239 | ||
| 240 | $last_run = $this->getLastrun(); |
|
| 241 | ||
| 242 | if ( is_null($lastrun) ) { |
|
| 243 | $next_run = $this->getFirstrun(); |
|
| 244 | } else { |
|
| 245 | $next_run = $this->buildExpression()->getNextRunDate($last_run); |
|
| 246 | } |
|
| 247 | ||
| 248 | return $time < $next_run; |
|
| 249 | ||
| 250 | } |
|
| 251 | ||
| 252 | public function getNextPlannedRun(DateTime $time) { |
|
| 253 | ||
| @@ 252-264 (lines=13) @@ | ||
| 249 | ||
| 250 | } |
|
| 251 | ||
| 252 | public function getNextPlannedRun(DateTime $time) { |
|
| 253 | ||
| 254 | $last_run = $this->getLastrun(); |
|
| 255 | ||
| 256 | if ( is_null($lastrun) ) { |
|
| 257 | $next_run = $this->getFirstrun(); |
|
| 258 | } else { |
|
| 259 | $next_run = $this->buildExpression()->getNextRunDate($time); |
|
| 260 | } |
|
| 261 | ||
| 262 | return $next_run; |
|
| 263 | ||
| 264 | } |
|
| 265 | ||
| 266 | protected function buildExpression() { |
|
| 267 | ||