| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function execute(CommandContext $commandContext) |
||
| 27 | { |
||
| 28 | $jobToDelete = null; |
||
|
|
|||
| 29 | foreach ($this->jobIds as $jobId) { |
||
| 30 | $jobToDelete = Context::getCommandContext() |
||
| 31 | ->getJobManager() |
||
| 32 | ->findJobById($jobId); |
||
| 33 | |||
| 34 | if ($jobToDelete !== null) { |
||
| 35 | // When given job doesn't exist, ignore |
||
| 36 | $jobToDelete->delete(); |
||
| 37 | |||
| 38 | if ($this->cascade) { |
||
| 39 | $commandContext |
||
| 40 | ->getHistoricJobLogManager() |
||
| 41 | ->deleteHistoricJobLogByJobId($this->jobId); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |
||
| 45 | return null; |
||
| 46 | } |
||
| 48 |