From: Matthias Schmidt Date: Sun, 4 Mar 2012 17:00:39 +0000 (+0100) Subject: PackageUpdateServer::getActiveUpdateServers() uses list X-Git-Tag: 2.0.0_Beta_1~1260^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7ca0881822fae11e7f15f7338e4b27c58875b0be;p=GitHub%2FWoltLab%2FWCF.git PackageUpdateServer::getActiveUpdateServers() uses list `wcf\data\package\update\server\PackageUpdateServer::getActiveUpdateServers()` now uses `wcf\data\package\update\server\PackageUpdateServerList`. --- 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(); } /**