Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class UserChanged extends PruningTemplatesTemplate |
||
9 | { |
||
10 | protected $keepVersions = 3; |
||
11 | |||
12 | public function setKeepVersions(int $keepVersions): self |
||
13 | { |
||
14 | $this->keepVersions = $keepVersions; |
||
15 | |||
16 | return $this; |
||
17 | } |
||
18 | |||
19 | public function getTitle(): string |
||
22 | } |
||
23 | |||
24 | public function getDescription(): string |
||
25 | { |
||
26 | return 'Delete versions that are not edited by a logged-in user.'; |
||
27 | } |
||
28 | |||
29 | public function run(?bool $verbose = false) |
||
30 | { |
||
31 | DB::query('SELECT * FROM SiteTree_Versions WHERE AuthorID > 0 AND RecordID = ' . $this->object->ID); |
||
32 | $this->markOlderItemsWithoutAuthor(); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * these can be deleted. |
||
37 | */ |
||
38 | protected function markOlderItemsWithoutAuthor() |
||
48 | ); |
||
49 | } |
||
50 | } |
||
51 |