PackageUpdateServer::getActiveUpdateServers() uses list
authorMatthias Schmidt <gravatronics@live.com>
Sun, 4 Mar 2012 17:00:39 +0000 (18:00 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 4 Mar 2012 17:00:39 +0000 (18:00 +0100)
`wcf\data\package\update\server\PackageUpdateServer::getActiveUpdateServers()` now uses `wcf\data\package\update\server\PackageUpdateServerList`.

wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServer.class.php

index 7a201679960ccc7a9f842213a311f64c4dff3ea9..547392b3b6f7f962a6ee7c42878e6f2be8ed1b6c 100644 (file)
@@ -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();
        }
        
        /**