From 7ca0881822fae11e7f15f7338e4b27c58875b0be Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 4 Mar 2012 18:00:39 +0100 Subject: [PATCH] PackageUpdateServer::getActiveUpdateServers() uses list `wcf\data\package\update\server\PackageUpdateServer::getActiveUpdateServers()` now uses `wcf\data\package\update\server\PackageUpdateServerList`. --- .../server/PackageUpdateServer.class.php | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php index 7a20167996..547392b3b6 100644 --- a/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php +++ b/wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php @@ -32,22 +32,15 @@ class PackageUpdateServer extends DatabaseObject { * @return array $servers */ public static function getActiveUpdateServers(array $packageUpdateServerIDs = array()) { - $servers = array(); - $conditions = new PreparedStatementConditionBuilder(); - $conditions->add("disabled = ?", array(0)); - if (count($packageUpdateServerIDs)) $conditions->add("packageUpdateServerID IN (?)", array($packageUpdateServerIDs)); - - $sql = "SELECT * - FROM wcf".WCF_N."_package_update_server - ".$conditions." - ORDER BY serverURL ASC"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute($conditions->getParameters()); - while ($row = $statement->fetchArray()) { - $servers[$row['packageUpdateServerID']] = new PackageUpdateServer(null, $row); + $list = new PackageUpdateServerList(); + $list->sqlLimit = 0; + $list->getConditionBuilder()->add("disabled = ?", array(0)); + if (count($packageUpdateServerIDs)) { + $list->getConditionBuilder()->add("packageUpdateServerID IN (?)", array($packageUpdateServerIDs)); } + $list->readObjects(); - return $servers; + return $list->getObjects(); } /** -- 2.20.1