mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT: Added documentation and changed static names (from r107429)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112593 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f179458542
commit
556e753fee
@ -177,7 +177,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
private static $nested_urls = false;
|
||||
|
||||
/**
|
||||
* @see SiteTree::disable_create_defaultpages()
|
||||
* @see SiteTree::set_create_defaultpages()
|
||||
*/
|
||||
private static $create_default_pages = true;
|
||||
|
||||
@ -222,10 +222,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the (re)creation of default pages on /dev/build
|
||||
* @param bool $option
|
||||
* Set the (re)creation of default pages on /dev/build
|
||||
*/
|
||||
|
||||
public static function set_create_defaultpages($option = true) {
|
||||
public static function set_create_default_pages($option = true) {
|
||||
self::$create_default_pages = $option;
|
||||
}
|
||||
|
||||
|
@ -62,14 +62,14 @@ class SiteTreeTest extends SapphireTest {
|
||||
$this->assertEquals(DB::query('SELECT COUNT("ID") FROM "SiteTree"')->value(), 0);
|
||||
|
||||
// Disable the creation
|
||||
SiteTree::set_create_defaultpages(false);
|
||||
SiteTree::set_create_default_pages(false);
|
||||
singleton('SiteTree')->requireDefaultRecords();
|
||||
|
||||
// The table should still be empty
|
||||
$this->assertEquals(DB::query('SELECT COUNT("ID") FROM "SiteTree"')->value(), 0);
|
||||
|
||||
// Enable the creation
|
||||
SiteTree::set_create_defaultpages(true);
|
||||
SiteTree::set_create_default_pages(true);
|
||||
singleton('SiteTree')->requireDefaultRecords();
|
||||
|
||||
// The table should now have three rows (home, about-us, contact-us)
|
||||
|
Loading…
x
Reference in New Issue
Block a user