This class attempts to run the extraStatics method without first checking it exists. There's no reason why a data object decorator would necessarily add extra statics.

This commit is contained in:
drzax 2011-08-11 12:01:26 +10:00
parent dfb0504d0d
commit cbd42ed053

3
model/DataExtension.php Executable file → Normal file
View File

@ -61,6 +61,9 @@ abstract class DataExtension extends Extension {
// 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 ( ! method_exists($extensionClass, $extraStaticsMethod) ) return;
$statics = call_user_func(array($extensionClass, $extraStaticsMethod), $class, $extension); $statics = call_user_func(array($extensionClass, $extraStaticsMethod), $class, $extension);