From: Matthias Schmidt Date: Wed, 20 Jul 2011 22:25:51 +0000 (+0200) Subject: Added support for multiple decorators X-Git-Tag: 2.0.0_Beta_1~1964^2~4^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=28914c73043b19872442ba9db72162a83759571c;p=GitHub%2FWoltLab%2FWCF.git Added support for multiple decorators It should be possible that a class that extends DatabaseObjectDecorator is decorated again (basic principle of the decorator pattern) which isn' t the case at the moment since the original object's methods can't be ca lled anymore, so we need to check if the base class itself is a decorate d object before the exception is thrown that the method doesn't exist. --- diff --git a/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php index 3ca2b7cd1d..001ae7afb3 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php @@ -65,7 +65,7 @@ abstract class DatabaseObjectDecorator extends DatabaseObject { * @return mixed */ public function __call($name, $arguments) { - if (!method_exists($this->object, $name)) { + if (!method_exists($this->object, $name) && !($this->object instanceof DatabaseObjectDecorator)) { throw new SystemException("unknown method '".$name."'"); }