diff --git a/.travis.yml b/.travis.yml index fc16ccb..e95ff3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,7 @@ php: - 5.3 env: - - DB=MYSQL CORE_RELEASE=3.0 - DB=MYSQL CORE_RELEASE=3.1 - - DB=MYSQL CORE_RELEASE=master - DB=PGSQL CORE_RELEASE=master matrix: diff --git a/README.md b/README.md index ab5c46c..babe675 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ the sidebar of your website. To check out a what a [Widget](http://silverstripe. ## Requirements - * SilverStripe 3.0 + * SilverStripe 3.1 ## How to Use A Widget @@ -53,8 +53,8 @@ e.g. class Page extends SiteTree { ... - static $has_one = array( - "MyWidgetArea" => "WidgetArea", + private static $has_one = array( + "MyWidgetArea" => "WidgetArea", ); public function getCMSFields() { @@ -105,7 +105,7 @@ An example widget is below: "Varchar", "Photoset" => "Varchar", "Tags" => "Varchar", @@ -113,14 +113,14 @@ An example widget is below: ); - static $defaults = array( + private static $defaults = array( "NumberToShow" => 8 ); - static $title = "Photos"; - static $cmsTitle = "Flickr Photos"; - static $description = "Shows flickr photos."; + private static $title = "Photos"; + private static $cmsTitle = "Flickr Photos"; + private static $description = "Shows flickr photos."; public function Photos() { Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js"); @@ -236,7 +236,7 @@ sure that your controller follows the usual naming conventions, and it will be a **mysite/code/MyWidget.php** class MyWidget extends Widget { - static $db = array( + private static $db = array( 'TestValue' => 'Text' ); } diff --git a/code/controller/WidgetContentControllerExtension.php b/code/controller/WidgetContentControllerExtension.php index 476d1e3..8e5d2b2 100644 --- a/code/controller/WidgetContentControllerExtension.php +++ b/code/controller/WidgetContentControllerExtension.php @@ -8,7 +8,7 @@ class WidgetContentControllerExtension extends Extension { * * @var array */ - public static $allowed_actions = array( + private static $allowed_actions = array( 'handleWidget' ); diff --git a/code/model/Widget.php b/code/model/Widget.php index 929301b..807a5ba 100644 --- a/code/model/Widget.php +++ b/code/model/Widget.php @@ -16,7 +16,7 @@ class Widget extends DataObject { * * @var array */ - public static $db = array( + private static $db = array( "Sort" => "Int", "Enabled" => "Boolean" ); @@ -25,7 +25,7 @@ class Widget extends DataObject { * * @var array */ - public static $defaults = array( + private static $defaults = array( 'Enabled' => true ); @@ -33,7 +33,7 @@ class Widget extends DataObject { * * @var array */ - public static $has_one = array( + private static $has_one = array( "Parent" => "WidgetArea", ); @@ -41,43 +41,43 @@ class Widget extends DataObject { * * @var array */ - public static $has_many = array(); + private static $has_many = array(); /** * * @var array */ - public static $many_many = array(); + private static $many_many = array(); /** * * @var array */ - public static $belongs_many_many = array(); + private static $belongs_many_many = array(); /** * * @var string */ - public static $default_sort = "\"Sort\""; + private static $default_sort = "\"Sort\""; /** * * @var string */ - public static $title = "Widget Title"; + private static $title = "Widget Title"; /** * * @var string */ - public static $cmsTitle = "Name of this widget"; + private static $cmsTitle = "Name of this widget"; /** * * @var string */ - public static $description = "Description of what this widget does."; + private static $description = "Description of what this widget does."; /** * @@ -245,7 +245,7 @@ class Widget_Controller extends Controller { * * @var array */ - public static $allowed_actions = array( + private static $allowed_actions = array( 'editablesegment' ); diff --git a/code/model/WidgetArea.php b/code/model/WidgetArea.php index 9c9d775..9d037f8 100644 --- a/code/model/WidgetArea.php +++ b/code/model/WidgetArea.php @@ -10,34 +10,10 @@ class WidgetArea extends DataObject { * * @var array */ - public static $db = array(); - - /** - * - * @var array - */ - public static $has_one = array(); - - /** - * - * @var array - */ - public static $has_many = array( + private static $has_many = array( "Widgets" => "Widget" ); - /** - * - * @var array - */ - public static $many_many = array(); - - /** - * - * @var array - */ - public static $belongs_many_many = array(); - /** * * @var string diff --git a/composer.json b/composer.json index b2adf45..c1c18e0 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { - "silverstripe/framework": "3.*", - "silverstripe/cms": "3.*" + "silverstripe/framework": "~3.1", + "silverstripe/cms": "~3.1" } } \ No newline at end of file diff --git a/tests/WidgetAreaEditorTest.php b/tests/WidgetAreaEditorTest.php index 5a32536..c14b5f9 100644 --- a/tests/WidgetAreaEditorTest.php +++ b/tests/WidgetAreaEditorTest.php @@ -447,17 +447,17 @@ class WidgetAreaEditorTest extends SapphireTest { } class WidgetAreaEditorTest_FakePage extends Page implements TestOnly { - public static $has_one = array( + private static $has_one = array( "SideBar" => "WidgetArea", "BottomBar" => "WidgetArea", ); } class WidgetAreaEditorTest_TestWidget extends Widget implements TestOnly { - static $cmsTitle = "Test widget"; - static $title = "Test widget"; - static $description = "Test widget"; - static $db = array( + private static $cmsTitle = "Test widget"; + private static $title = "Test widget"; + private static $description = "Test widget"; + private static $db = array( 'Title' => 'Varchar' ); public function getCMSFields() { diff --git a/tests/WidgetControllerTest.php b/tests/WidgetControllerTest.php index a254cb9..d2d9644 100644 --- a/tests/WidgetControllerTest.php +++ b/tests/WidgetControllerTest.php @@ -4,7 +4,7 @@ * @subpackage tests */ class WidgetControllerTest extends FunctionalTest { - static $fixture_file = 'WidgetControllerTest.yml'; + protected static $fixture_file = 'WidgetControllerTest.yml'; protected $extraDataObjects = array( 'WidgetControllerTestPage', @@ -54,7 +54,7 @@ class WidgetControllerTest extends FunctionalTest { * @subpackage tests */ class WidgetControllerTest_Widget extends Widget implements TestOnly { - static $db = array( + private static $db = array( 'TestValue' => 'Text' ); } diff --git a/tests/WidgetControllerTestPage.php b/tests/WidgetControllerTestPage.php index f8821ee..5bbd299 100644 --- a/tests/WidgetControllerTestPage.php +++ b/tests/WidgetControllerTestPage.php @@ -4,7 +4,7 @@ * @subpackage tests */ class WidgetControllerTestPage extends Page implements TestOnly { - static $has_one = array( + private static $has_one = array( 'WidgetControllerTestSidebar' => 'WidgetArea' ); }