From: Alexander Ebert Date: Fri, 24 Feb 2012 22:54:18 +0000 (+0100) Subject: ObjectType::getProcessor() now supports SingletonFactory X-Git-Tag: 2.0.0_Beta_1~1308 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ca71e1fde3c4dff6994ef95824e24ef4cef110e1;p=GitHub%2FWoltLab%2FWCF.git ObjectType::getProcessor() now supports SingletonFactory --- diff --git a/wcfsetup/install/files/lib/data/object/type/ObjectType.class.php b/wcfsetup/install/files/lib/data/object/type/ObjectType.class.php index e4042c0b0f..61cbb78969 100644 --- a/wcfsetup/install/files/lib/data/object/type/ObjectType.class.php +++ b/wcfsetup/install/files/lib/data/object/type/ObjectType.class.php @@ -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); + } } }