Permalink
Browse files

API CHANGE: Made ModelAdmin's configuration statics public rather tha…

…n protected, so that they can be accessed with Object::get_static()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@76124 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 5f8839b commit b2aa86140a67dc9cf6ea928e94e7f57279d3ecc5 @sminnee sminnee committed May 6, 2009
Showing with 6 additions and 8 deletions.
  1. +5 −5 code/ModelAdmin.php
  2. +1 −3 tests/ModelAdminTest.php
View
@@ -36,7 +36,7 @@
*
* @var array|string
*/
- protected static $managed_models = null;
+ public static $managed_models = null;
/**
* More actions are dynamically added in {@link defineMethods()} below.
@@ -55,12 +55,12 @@
/**
* @param string $collection_controller_class Override for controller class
*/
- protected static $collection_controller_class = "ModelAdmin_CollectionController";
+ public static $collection_controller_class = "ModelAdmin_CollectionController";
/**
* @param string $collection_controller_class Override for controller class
*/
- protected static $record_controller_class = "ModelAdmin_RecordController";
+ public static $record_controller_class = "ModelAdmin_RecordController";
/**
* Forward control to the default action handler
@@ -87,14 +87,14 @@
*
* @var array
*/
- protected static $model_importers = null;
+ public static $model_importers = null;
/**
* Amount of results showing on a single page.
*
* @var int
*/
- protected static $page_length = 30;
+ public static $page_length = 30;
/**
* Class name of the form field used for the results list. Overloading this in subclasses
View
@@ -7,16 +7,14 @@ function testModelAdminOpens() {
$this->autoFollowRedirection = false;
$this->logInAs('admin');
$this->assertTrue((bool)Permission::check("ADMIN"));
-
- Debug::message($this->get('ModelAdminTest_Admin')->getBody());
$this->assertEquals(200, $this->get('ModelAdminTest_Admin')->getStatusCode());
}
}
class ModelAdminTest_Admin extends ModelAdmin {
static $url_segment = 'testadmin';
- protected static $managed_models = array(
+ public static $managed_models = array(
'ModelAdminTest_Contact',
);
}

0 comments on commit b2aa861

Please sign in to comment.