Completed
Push — master ( 41d4aa...7dfe14 )
by Damian
02:52
created

SideReport_RecentlyEdited::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/**
4
 * @package cms
5
 * @subpackage reports
6
 */
7
class RecentlyEditedReport extends SS_Report {
8
9
	public function title() {
10
		return _t('SideReport.LAST2WEEKS',"Pages edited in the last 2 weeks");
11
	}
12
13
	public function group() {
14
		return _t('SideReport.ContentGroupTitle', "Content reports");
15
	}
16
17
	public function sort() {
18
		return 200;
19
	}
20
21
	public function sourceRecords($params = null) {
0 ignored issues
show
Unused Code introduced by
The parameter $params is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
		$threshold = strtotime('-14 days', SS_Datetime::now()->Format('U'));
23
		return DataObject::get("SiteTree", "\"SiteTree\".\"LastEdited\" > '".date("Y-m-d H:i:s", $threshold)."'", "\"SiteTree\".\"LastEdited\" DESC");
24
	}
25
	
26
	public function columns() {
27
		return array(
28
			"Title" => array(
29
				"title" => "Title", // todo: use NestedTitle(2)
30
				"link" => true,
31
			),
32
		);
33
	}
34
}
35
36
/**
37
 * @deprecated 3.2..4.0
38
 */
39
class SideReport_RecentlyEdited extends RecentlyEditedReport {
40
	public function __construct() {
41
		Deprecation::notice('4.0', 'Use RecentlyEditedReport instead');
42
		parent::__construct();
43
	}
44
}
45