MINOR Don't use deprecated extraStatics when adding extra statics with

DataExtension
This commit is contained in:
Sean Harvey 2012-05-23 22:13:27 +12:00
parent ec3ebc91d8
commit 542d727db2
3 changed files with 18 additions and 27 deletions

View File

@ -5,13 +5,9 @@
*/ */
class SiteTreeFileExtension extends DataExtension { class SiteTreeFileExtension extends DataExtension {
function extraStatics($class = null, $extension = null) { public static $belongs_many_many = array(
return array( 'BackLinkTracking' => 'SiteTree'
'belongs_many_many' => array( );
"BackLinkTracking" => "SiteTree",
)
);
}
/** /**
* Extend through {@link updateBackLinkTracking()} in your own {@link Extension}. * Extend through {@link updateBackLinkTracking()} in your own {@link Extension}.

View File

@ -243,13 +243,10 @@ class SiteTreeBacklinksTest extends SapphireTest {
} }
class SiteTreeBacklinksTest_DOD extends DataExtension implements TestOnly { class SiteTreeBacklinksTest_DOD extends DataExtension implements TestOnly {
function extraStatics($class = null, $extension = null) {
return array( static $db = array(
'db' => array( 'ExtraContent' => 'HTMLText',
'ExtraContent' => 'HTMLText', );
),
);
}
function updateCMSFields(FieldList $fields) { function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab("Root.Content", new HTMLEditorField("ExtraContent")); $fields->addFieldToTab("Root.Content", new HTMLEditorField("ExtraContent"));

View File

@ -607,14 +607,12 @@ class VirtualPageTest_VirtualPageSub extends VirtualPage implements TestOnly {
} }
class VirtualPageTest_PageExtension extends DataExtension implements TestOnly { class VirtualPageTest_PageExtension extends DataExtension implements TestOnly {
function extraStatics($class = null, $extension = null) {
return array( static $db = array(
'db' => array( // These fields are just on an extension to simulate shared properties between Page and VirtualPage.
// These fields are just on an extension to simulate shared properties between Page and VirtualPage. // Not possible through direct $db definitions due to VirtualPage inheriting from Page, and Page being defined elsewhere.
// Not possible through direct $db definitions due to VirtualPage inheriting from Page, and Page being defined elsewhere. 'MySharedVirtualField' => 'Text',
'MySharedVirtualField' => 'Text', 'MySharedNonVirtualField' => 'Text',
'MySharedNonVirtualField' => 'Text', );
)
);
}
} }