Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MINOR: strict standard updates and updating to 3.0 API

  • Loading branch information...
commit 0af3d61f8fa2c5a38e5c0b89c7aa1a52b06e3b15 1 parent f8de5b0
Will Rossiter authored June 10, 2012
19  code/GoogleAnalyzer.php
... ...
@@ -1,6 +1,9 @@
1 1
 <?php
2 2
 
3  
-class GoogleAnalyzer extends DataObjectDecorator {
  3
+/**
  4
+ * @package googleanalytics
  5
+ */
  6
+class GoogleAnalyzer extends DataExtension {
4 7
 
5 8
 	static public $sapphire_version;
6 9
 
@@ -9,13 +12,9 @@ class GoogleAnalyzer extends DataObjectDecorator {
9 12
 	public static $email;
10 13
 	public static $password;
11 14
 
12  
-	function extraStatics() {
13  
-		return array(
14  
-			'has_many' => array(
15  
-				'Events' => 'GoogleLogEvent',
16  
-			),
17  
-		);
18  
-	}
  15
+	public $has_many = array(
  16
+		'Events' => 'GoogleLogEvent',
  17
+	);
19 18
 
20 19
 	/**
21 20
 	 *	for legacy reasons
@@ -48,10 +47,8 @@ public static function activate($profile = 'SiteConfig', $email = null, $passwor
48 47
 		Object::add_extension('SiteTree', 'GoogleAnalyzer');
49 48
 	}
50 49
 
51  
-	public function updateCMSFields(FieldSet $fields) {
52  
-
  50
+	public function updateCMSFields(FieldList $fields) {
53 51
 		$fields->addFieldToTab('Root', new Tab('GoogleAnalytics', 'Google Analytics'));
54  
-		
55 52
 		$fields->addFieldToTab("Root.GoogleAnalytics", new TabSet('Stats'));
56 53
 		$fields->addFieldToTab('Root.GoogleAnalytics.Stats', new Tab('Performance', 'Performance'));
57 54
 		$fields->addFieldToTab("Root.GoogleAnalytics.Stats.Performance", new GooglePerformanceChart($this->owner));
23  code/GoogleConfig.php
... ...
@@ -1,19 +1,18 @@
1 1
 <?php
2 2
 
3  
-class GoogleConfig extends DataObjectDecorator {
  3
+/**
  4
+ * @package googleanalytics
  5
+ */
  6
+class GoogleConfig extends DataExtension {
4 7
 
5  
-	function extraStatics() {
6  
-		return array(
7  
-			'db' => array(
8  
-				'GoogleAnalyticsCode' => 'Varchar',
9  
-				'GoogleAnalyticsProfileId' => 'Varchar',
10  
-				'GoogleAnalyticsEmail' => 'Varchar',
11  
-				'GoogleAnalyticsPassword' => 'Varchar',
12  
-			),
13  
-		);
14  
-	}
  8
+	public $db = array(
  9
+		'GoogleAnalyticsCode' => 'Varchar',
  10
+		'GoogleAnalyticsProfileId' => 'Varchar',
  11
+		'GoogleAnalyticsEmail' => 'Varchar',
  12
+		'GoogleAnalyticsPassword' => 'Varchar',
  13
+	);
15 14
 
16  
-	public function updateCMSFields(FieldSet $fields) {
  15
+	public function updateCMSFields(FieldList $fields) {
17 16
 
18 17
 		$fields->addFieldToTab("Root", new Tab('GoogleAnalytics'));
19 18
 		$fields->addFieldToTab('Root.GoogleAnalytics', new TextField('GoogleAnalyticsCode', 'Google Analytics Code (UA-XXXXXX-X)'));
4  code/GoogleLogger.php
@@ -74,14 +74,14 @@ public function onAfterInit() {
74 74
 	/**
75 75
 	 * @param bool
76 76
 	 */
77  
-	public function set_event_tracking_enabled($bool) {
  77
+	public static function set_event_tracking_enabled($bool) {
78 78
 		self::$include_event_tracking = (bool) $bool;
79 79
 	}
80 80
 	
81 81
 	/**
82 82
 	 * @return bool
83 83
 	 */
84  
-	public function event_tracking_enabled() {
  84
+	public static function event_tracking_enabled() {
85 85
 		return self::$include_event_tracking;
86 86
 	}
87 87
 }

0 notes on commit 0af3d61

Please sign in to comment.
Something went wrong with that request. Please try again.