| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public function run(?bool $verbose = false) |
||
| 39 | { |
||
| 40 | // remove drafts keeping `keep_drafts` |
||
| 41 | if ($this->keepDraftCount > 0) { |
||
| 42 | $query = $this->getBaseQuery(['WasPublished']) |
||
| 43 | ->addWhere( |
||
| 44 | [ |
||
| 45 | 'RecordID = ' . $this->object->ID, |
||
| 46 | 'WasPublished = 0', |
||
| 47 | ] |
||
| 48 | ) |
||
| 49 | ->setLimit($this->normaliseLimit(), $this->normaliseOffset($this->keepDraftCount)) |
||
| 50 | ; |
||
| 51 | |||
| 52 | $this->toDelete[$this->getUniqueKey()] += $this->addVersionNumberToArray( |
||
| 53 | $this->toDelete[$this->getUniqueKey()], |
||
| 54 | $query->execute() |
||
| 55 | ); |
||
| 59 |