From 521402326930e76d8bea0878c45bcf262b76d50c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 11 Aug 2011 16:30:09 +0200 Subject: [PATCH] DatabaseObjectList assigns table index value as array key --- .../install/files/lib/data/DatabaseObjectList.class.php | 7 +++++++ 1 file changed, 7 insertions(+) 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; } /** -- 2.20.1