Merge pull request #43 from drzax/sapphire

---

This class attempts to run the extraStatics method without first checking it exists. Theres no reason why a data object decorator would necessarily add extra statics.
This commit is contained in:
Ingo Schommer 2011-08-14 13:36:07 +02:00
commit 507c8caa20

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(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);