Added enhanced __get() for ModificationLog
authorAlexander Ebert <ebert@woltlab.com>
Mon, 11 Jun 2012 23:26:05 +0000 (01:26 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 11 Jun 2012 23:26:05 +0000 (01:26 +0200)
wcfsetup/install/files/lib/data/modification/log/ModificationLog.class.php

index c95ce05bfad2f843ed600dea5aefaaa106e3e07c..d2369ad121d5ebbad06633771fb20ba578d5d82e 100644 (file)
@@ -22,4 +22,20 @@ class ModificationLog extends DatabaseObject {
         * @see wcf\data\DatabaseObject::$databaseTableIndexName
         */
        protected static $databaseTableIndexName = 'logID';
+       
+       /**
+        * @see wcf\data\IStorableObject::__get()
+        */
+       public function __get($name) {
+               $value = parent::__get($name);
+       
+               // treat additional data as data variables if it is an array
+               if ($value === null) {
+                       if (is_array($this->data['additionalData']) && isset($this->data['additionalData'][$name])) {
+                               $value = $this->data['additionalData'][$name];
+                       }
+               }
+       
+               return $value;
+       }
 }