From: Alexander Ebert Date: Thu, 11 Aug 2011 14:30:09 +0000 (+0200) Subject: DatabaseObjectList assigns table index value as array key X-Git-Tag: 2.0.0_Beta_1~1886^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=521402326930e76d8bea0878c45bcf262b76d50c;p=GitHub%2FWoltLab%2FWCF.git DatabaseObjectList assigns table index value as array key --- diff --git a/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php index 2cc734977e..d342f23fe4 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php @@ -154,6 +154,13 @@ abstract class DatabaseObjectList { $statement->execute($this->getConditionBuilder()->getParameters()); $this->objects = $statement->fetchObjects($this->className); } + + // use table index as array index + $objects = array(); + foreach($this->objects as $object) { + $objects[$object->{$this->getDatabaseTableIndexName()}] = $object; + } + $this->objects = $objects; } /**