If additional data is an array and contains a serialized array, ObjectType will treat its content as data variables (allows $objectType->foo access)
*/
protected static $databaseTableIndexName = 'objectTypeID';
+ /**
+ * @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->additionalData) && isset($this->additionalData[$name])) {
+ $value = $this->additionalData[$name];
+ }
+ }
+
+ return $value;
+ }
+
/**
* @see wcf\data\ProcessibleDatabaseObject::getProcessor()
*/
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array($packageID));
while ($row = $statement->fetchArray()) {
+ $row['additionalData'] = unserialize($row['additionalData']);
$data['objectTypes'][$row['objectTypeID']] = new ObjectType(null, $row);
}