mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API CHANGE Removed support for extraDBFields method in DataExtension, please ensure you are using extraStatics on your extension classes
This commit is contained in:
parent
49267dbbc4
commit
71c2a2286a
@ -51,21 +51,13 @@ abstract class DataExtension extends Extension {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @deprecated 2.4 - use extraStatics() now, not extraDBFields()
|
|
||||||
if(method_exists($extensionClass, 'extraDBFields')) {
|
|
||||||
Deprecation::notice('2.4', 'DataExtension::extraDBFields() is deprecated. Please use extraStatics() instead.');
|
|
||||||
$extraStaticsMethod = 'extraDBFields';
|
|
||||||
} else {
|
|
||||||
$extraStaticsMethod = 'extraStatics';
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the extension has been manually applied to a subclass, we should ignore that.
|
// If the extension has been manually applied to a subclass, we should ignore that.
|
||||||
if(Object::has_extension(get_parent_class($class), $extensionClass)) return;
|
if(Object::has_extension(get_parent_class($class), $extensionClass)) return;
|
||||||
|
|
||||||
// If there aren't any extraStatics we shouldn't try to load them.
|
// If there aren't any extraStatics we shouldn't try to load them.
|
||||||
if (!method_exists($extensionClass, $extraStaticsMethod) ) return;
|
if(!method_exists($extensionClass, 'extraStatics')) return;
|
||||||
|
|
||||||
$statics = call_user_func(array(singleton($extensionClass), $extraStaticsMethod), $class, $extension);
|
$statics = call_user_func(array(singleton($extensionClass), 'extraStatics'), $class, $extension);
|
||||||
|
|
||||||
if($statics) {
|
if($statics) {
|
||||||
foreach($statics as $name => $newVal) {
|
foreach($statics as $name => $newVal) {
|
||||||
|
Loading…
Reference in New Issue
Block a user