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

SideReport_RecentlyEdited   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 6
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
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