Skip to content

Commit

Permalink
API CHANGE Removed support for extraDBFields method in DataExtension,…
Browse files Browse the repository at this point in the history
… please ensure you are using extraStatics on your extension classes
  • Loading branch information
Sean Harvey committed Mar 9, 2012
1 parent 49267db commit 71c2a22
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions model/DataExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,13 @@ public static function load_extra_statics($class, $extension) {
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(Object::has_extension(get_parent_class($class), $extensionClass)) return;

// If there aren't any extraStatics we shouldn't try to load them.
if (!method_exists($extensionClass, $extraStaticsMethod) ) return;
$statics = call_user_func(array(singleton($extensionClass), $extraStaticsMethod), $class, $extension);
if(!method_exists($extensionClass, 'extraStatics')) return;

$statics = call_user_func(array(singleton($extensionClass), 'extraStatics'), $class, $extension);

if($statics) {
foreach($statics as $name => $newVal) {
Expand Down

0 comments on commit 71c2a22

Please sign in to comment.