sunnysideup /
silverstripe-health-check-provider
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Sunnysideup\HealthCheckProvider\Checks\Content; |
||
| 4 | |||
| 5 | use SilverStripe\ORM\DB; |
||
| 6 | use Sunnysideup\HealthCheckProvider\Checks\HealthCheckItemRunner; |
||
| 7 | |||
| 8 | class PageEditsInLastYear extends HealthCheckItemRunner |
||
| 9 | { |
||
| 10 | private static $limit = 3; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 11 | |||
| 12 | public function getCalculatedAnswer(): array |
||
| 13 | { |
||
| 14 | $returnArray = []; |
||
| 15 | $rows = DB::query('SELECT unix_timestamp(LastEdited) as A FROM SiteTree_Versions'); |
||
| 16 | foreach ($rows as $row) { |
||
| 17 | $returnArray[] = $row['A']; |
||
| 18 | } |
||
| 19 | |||
| 20 | return $returnArray; |
||
| 21 | } |
||
| 22 | |||
| 23 | protected function nameSpacesRequired(): array |
||
| 24 | { |
||
| 25 | return [ |
||
| 26 | 'SilverStripe\\Reports', |
||
| 27 | ]; |
||
| 28 | } |
||
| 29 | } |
||
| 30 |