ObjectType::getProcessor() now supports SingletonFactory
authorAlexander Ebert <ebert@woltlab.com>
Fri, 24 Feb 2012 22:54:18 +0000 (23:54 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 24 Feb 2012 22:54:18 +0000 (23:54 +0100)
wcfsetup/install/files/lib/data/object/type/ObjectType.class.php

index e4042c0b0f91e0310bf58085c650dfee10d4dd7b..61cbb78969fc3e1b1b355c8fa18b850ac9d0ecf6 100644 (file)
@@ -64,7 +64,12 @@ class ObjectType extends ProcessibleDatabaseObject {
                                        throw new SystemException("'".$this->className."' should implement ".$definitionInterface);
                                }
                                
-                               $this->processor = new $this->className($this);
+                               if (ClassUtil::isInstanceOf($this->className, 'wcf\system\SingletonFactory')) {
+                                       $this->processor = call_user_func(array($this->className, 'getInstance'));
+                               }
+                               else {
+                                       $this->processor = new $this->className($this);
+                               }
                        }
                }