Use \PDO::fetchAll() instead of PreparedStatement::fetchColumns()
authorMatthias Schmidt <gravatronics@live.com>
Sun, 8 May 2016 08:57:32 +0000 (10:57 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 8 May 2016 08:57:32 +0000 (10:57 +0200)
41 files changed:
wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php
wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php
wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php
wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php
wcfsetup/install/files/lib/acp/page/UserListPage.class.php
wcfsetup/install/files/lib/data/DatabaseObjectList.class.php
wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php
wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php
wcfsetup/install/files/lib/data/box/Box.class.php
wcfsetup/install/files/lib/data/comment/CommentEditor.class.php
wcfsetup/install/files/lib/data/label/LabelAction.class.php
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php
wcfsetup/install/files/lib/data/page/Page.class.php
wcfsetup/install/files/lib/data/style/StyleEditor.class.php
wcfsetup/install/files/lib/data/user/TeamList.class.php
wcfsetup/install/files/lib/data/user/User.class.php
wcfsetup/install/files/lib/data/user/UserAction.class.php
wcfsetup/install/files/lib/data/user/UserProfile.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php
wcfsetup/install/files/lib/data/user/group/UserGroup.class.php
wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorAction.class.php
wcfsetup/install/files/lib/form/SearchForm.class.php
wcfsetup/install/files/lib/form/UserSearchForm.class.php
wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php
wcfsetup/install/files/lib/system/database/statement/PreparedStatement.class.php
wcfsetup/install/files/lib/system/edit/EditHistoryManager.class.php
wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php
wcfsetup/install/files/lib/system/importer/UserImporter.class.php
wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php
wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/session/SessionHandler.class.php
wcfsetup/install/files/lib/system/user/collapsible/content/UserCollapsibleContentHandler.class.php
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php
wcfsetup/install/files/lib/system/user/notification/object/type/TMultiRecipientModerationQueueCommentUserNotificationObjectType.class.php
wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php

index effab7b6395244d3167494ea5052946aded4fbfa..4acc62fcde7eb23cc9f9d4da0e58addebb4e90ff 100644 (file)
@@ -97,7 +97,7 @@ class UserQuickSearchAction extends AbstractAction {
                                        WHERE           banned = ?";
                                $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
                                $statement->execute(array(1));
-                               $this->matches = $statement->fetchColumns();
+                               $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                break;
                                
                        case 'newest':
@@ -111,7 +111,7 @@ class UserQuickSearchAction extends AbstractAction {
                                        ORDER BY        user_table.registrationDate DESC";
                                $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
                                $statement->execute();
-                               $this->matches = $statement->fetchColumns();
+                               $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                break;
                        
                        case 'disabled':
@@ -125,7 +125,7 @@ class UserQuickSearchAction extends AbstractAction {
                                        ORDER BY        user_table.registrationDate DESC";
                                $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
                                $statement->execute(array(0));
-                               $this->matches = $statement->fetchColumns();
+                               $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                break;
                        
                        case 'disabledAvatars':
@@ -136,7 +136,7 @@ class UserQuickSearchAction extends AbstractAction {
                                        WHERE           disableAvatar = ?";
                                $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
                                $statement->execute(array(1));
-                               $this->matches = $statement->fetchColumns();
+                               $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                break;
                                        
                        case 'disabledSignatures':
@@ -147,7 +147,7 @@ class UserQuickSearchAction extends AbstractAction {
                                        WHERE           disableSignature = ?";
                                $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
                                $statement->execute(array(1));
-                               $this->matches = $statement->fetchColumns();
+                               $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                break;
                }
                
index f861b04d477a7788b8f1de05a5be798ac973e68d..0704dee86756e9a42a06340b7fba7068124a84d8 100644 (file)
@@ -317,7 +317,7 @@ class BoxAddForm extends AbstractForm {
                                " . $conditionBuilder;
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($conditionBuilder->getParameters());
-                       $this->pageIDs = $statement->fetchColumns();
+                       $this->pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                }
                
                // validate images
index 6c94b85c8d07686d907449450178ee42b7a2bb7a..285f8e0cb38c39a5807cabbe224322f74d15954d 100644 (file)
@@ -132,7 +132,7 @@ class MenuAddForm extends AbstractForm {
                                " . $conditionBuilder;
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($conditionBuilder->getParameters());
-                       $this->pageIDs = $statement->fetchColumns();
+                       $this->pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                }
        }
        
index ca1002f98d1725a779e5f85335b0f9ceb4ae40f0..308c1599dc7c0fcbcdd2961da2d311aeee94b224 100644 (file)
@@ -336,7 +336,7 @@ class StyleAddForm extends AbstractForm {
                        FROM    wcf".WCF_N."_style_variable";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
-               $variables = $statement->fetchColumns();
+               $variables = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                $lines = explode("\n", StringUtil::unifyNewlines($this->variables['overrideScss']));
                $regEx = new Regex('^@([a-zA-Z]+): ?([@a-zA-Z0-9 ,\.\(\)\%\#-]+);$');
index 2beb0b4f5a7b3153987cc2dfea4856eb8598286f..15aaf7144f453fb47ba2cc3410036d4e3855f6c8 100755 (executable)
@@ -240,7 +240,7 @@ class UserListPage extends SortablePage {
                        ORDER BY        ".(($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'user_option_value.userOption'.$this->options[$this->sortField]->optionID : $this->sortField)." ".$this->sortOrder;
                $statement = WCF::getDB()->prepareStatement($sql, $this->itemsPerPage, ($this->pageNo - 1) * $this->itemsPerPage);
                $statement->execute($this->conditions->getParameters());
-               $userIDs = $statement->fetchColumns();
+               $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                // get user data
                if (!empty($userIDs)) {
index 1bef8c98939ade9f5a653766fdfa4528507b2305..2a0b7f5d42366666b7a496a54d148c44fe711f4d 100644 (file)
@@ -165,7 +165,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject {
                                ".(!empty($this->sqlOrderBy) ? "ORDER BY ".$this->sqlOrderBy : '');
                $statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset);
                $statement->execute($this->getConditionBuilder()->getParameters());
-               $this->objectIDs = $statement->fetchColumns();
+               $this->objectIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
        }
        
        /**
index 171e0713fc102ae9e26fd132f3988124d746c060..c3e1e6f09da30222d74493256a874dd7a3e24567 100644 (file)
@@ -261,7 +261,7 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $attachmentIDs = $statement->fetchColumns();
+               $attachmentIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                foreach ($this->parameters['attachmentIDs'] as $attachmentID) {
                        if (!in_array($attachmentID, $attachmentIDs)) {
index 2ef4ed8e9567f88644557c1bf41ae01f4a80f9e4..1c304cd84ed0bfa4e96a280d40dec88f84f055a0 100644 (file)
@@ -51,7 +51,7 @@ class BBCodeAction extends AbstractDatabaseObjectAction implements IToggleAction
                        WHERE   optionType = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute(array('BBCodeSelect'));
-               $optionIDs = $statement->fetchColumns();
+               $optionIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($optionIDs)) {
                        $conditionBuilder = new PreparedStatementConditionBuilder();
index 3d3d6a56aa61a13b7b08bb74b8e2b7ea45ca4ea3..9e43fd1819d399fbcaf7e02996de138d423072f8 100644 (file)
@@ -460,7 +460,7 @@ class Box extends DatabaseObject {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute([$this->boxID]);
                        
-                       $this->pageIDs = $statement->fetchColumns();
+                       $this->pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                }
                
                return $this->pageIDs;
index 1903c579c95db788730b1bb567b0acc5f394f4e9..0d020497bf1b06ca011d69988bd32097099571c0 100644 (file)
@@ -29,7 +29,7 @@ class CommentEditor extends DatabaseObjectEditor {
                        ORDER BY        time ASC, responseID ASC";
                $statement = WCF::getDB()->prepareStatement($sql, 5);
                $statement->execute(array($this->commentID));
-               $responseIDs = $statement->fetchColumns();
+               $responseIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                $this->update(array(
                        'responseIDs' => serialize($responseIDs)
index b3a90c19dca4be3b9f6ab8ed5de259dcd119fdae..d2fb1b0e97fce028945334ecdc4bb8d21a9538dc 100644 (file)
@@ -100,7 +100,7 @@ class LabelAction extends AbstractDatabaseObjectAction implements ISortableActio
                                        ".$conditions;
                                $statement = WCF::getDB()->prepareStatement($sql);
                                $statement->execute($conditions->getParameters());
-                               $languageItemIDs = $statement->fetchColumns();
+                               $languageItemIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                
                                $objectAction = new LanguageItemAction($languageItemIDs, 'delete');
                                $objectAction->executeAction();
index 43072696d6faffbfa441ce6234018682f5b448c9..321970b148b88277e376ae159a8b1b1a40f4554e 100644 (file)
@@ -120,7 +120,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                        ORDER BY        moderation_queue.lastChangeTime DESC";
                $statement = WCF::getDB()->prepareStatement($sql, 5);
                $statement->execute($conditions->getParameters());
-               $queueIDs = $statement->fetchColumns();
+               $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                $queues = array();
                if (!empty($queueIDs)) {
index b40033b1cfec1480c01bb354e8d464a9fd676c21..48181a81043bf64a5d8367d3c307acb67adac113 100644 (file)
@@ -275,7 +275,7 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject {
                                WHERE   pageID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute([$this->pageID]);
-                       $this->boxIDs = $statement->fetchColumns();
+                       $this->boxIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                }
                
                return $this->boxIDs;
index 7d541668cbd9c541430f2958cb9cbcb85a3b00df..121a12a283f427ea9a41d224605c9271b4f6e5b8 100644 (file)
@@ -420,7 +420,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                                                WHERE   templateGroupID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
                                        $statement->execute([$style->templateGroupID]);
-                                       $knownTemplates = $statement->fetchColumns();
+                                       $knownTemplates = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                }
                                
                                // copy templates
index 6836c7bbd48ccb82fe1725cc3393f99861c3b1f5..c4ed80279a276cdbe3687de06af0a6573da41e69 100644 (file)
@@ -51,7 +51,7 @@ class TeamList extends UserProfileList {
                        ORDER BY        user_group.priority DESC".(!empty($this->sqlOrderBy) ? ", ".$this->sqlOrderBy : '');
                $statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset);
                $statement->execute();
-               $this->objectIDs = $statement->fetchColumns();
+               $this->objectIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
        }
        
        /**
index c9fb30732283d051fc97eb82bb7c98a361df7334..a6dd23718c1bea230cf530edb71c8afa2ae91b2d 100644 (file)
@@ -208,7 +208,7 @@ final class User extends DatabaseObject implements IRouteController, IUserConten
                                                WHERE   userID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
                                        $statement->execute([$this->userID]);
-                                       $this->groupIDs = $statement->fetchColumns();
+                                       $this->groupIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                        
                                        // update storage data
                                        if (!$skipCache) {
@@ -246,7 +246,7 @@ final class User extends DatabaseObject implements IRouteController, IUserConten
                                                WHERE   userID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
                                        $statement->execute([$this->userID]);
-                                       $this->languageIDs = $statement->fetchColumns();
+                                       $this->languageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                        
                                        // update storage data
                                        UserStorageHandler::getInstance()->update($this->userID, 'languageIDs', serialize($this->languageIDs));
index 251c8127eac7b9165af9f456d90fe7917e6ea703..97618dabddc953afb97c50e239a6930dc6aaf839 100644 (file)
@@ -95,7 +95,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $groupIDs = $statement->fetchColumns();
+               $groupIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!UserGroup::isAccessibleGroup($groupIDs)) {
                        throw new PermissionDeniedException();
index 934dbac13195c8702c1d09513b437c09b4176aac..61e9860cb34af2060fb8cdbe6d83985b634ab06c 100644 (file)
@@ -168,7 +168,7 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject {
                                                WHERE   userID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
                                        $statement->execute([$this->userID]);
-                                       $this->followingUserIDs = $statement->fetchColumns();
+                                       $this->followingUserIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                        
                                        // update storage data
                                        UserStorageHandler::getInstance()->update($this->userID, 'followingUserIDs', serialize($this->followingUserIDs));
@@ -202,7 +202,7 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject {
                                                WHERE   followUserID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
                                        $statement->execute([$this->userID]);
-                                       $this->followerUserIDs = $statement->fetchColumns();
+                                       $this->followerUserIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                        
                                        // update storage data
                                        UserStorageHandler::getInstance()->update($this->userID, 'followerUserIDs', serialize($this->followerUserIDs));
@@ -236,7 +236,7 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject {
                                                WHERE   userID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
                                        $statement->execute([$this->userID]);
-                                       $this->ignoredUserIDs = $statement->fetchColumns();
+                                       $this->ignoredUserIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                        
                                        // update storage data
                                        UserStorageHandler::getInstance()->update($this->userID, 'ignoredUserIDs', serialize($this->ignoredUserIDs));
index 38a9b0f14ada3a4f1d339c9edb16a0e8d9a59183..999a0678e11341f9d398071f13600b009879a328 100644 (file)
@@ -198,7 +198,7 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
                        WHERE   followUserID = ?";
                $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
                $statement->execute(array($this->parameters['userID']));
-               $userIDs = $statement->fetchColumns();
+               $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                // create group
                $group = new GroupedUserList();
index 46f79b55ee898f255f1d348d5e68a98c297d5b23..93fd45fd0dc745c99233da5d6eb01dedb4bb9f70 100644 (file)
@@ -52,7 +52,7 @@ class UserFollowingAction extends UserFollowAction {
                        WHERE   userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
                $statement->execute(array($this->parameters['userID']));
-               $userIDs = $statement->fetchColumns();
+               $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                // create group
                $group = new GroupedUserList();
index 18f528b4e3771fdfbb8c3fc64ffff3b237b2cdf3..4820ee78f0677b499fd44cd24429775dc46baaf6 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\data\user\group;
+use wcf\data\ITitledObject;
 use wcf\data\user\User;
 use wcf\data\DatabaseObject;
 use wcf\system\cache\builder\UserGroupCacheBuilder;
@@ -25,7 +26,7 @@ use wcf\system\WCF;
  * @property-read      string          $userOnlineMarking
  * @property-read      integer         $showOnTeamPage
  */
-class UserGroup extends DatabaseObject {
+class UserGroup extends DatabaseObject implements ITitledObject {
        /**
         * group type everyone user group
         * @var integer
@@ -371,4 +372,11 @@ class UserGroup extends DatabaseObject {
                
                return null;
        }
+       
+       /**
+        * @inheritDoc
+        */
+       public function getTitle() {
+               return WCF::getLanguage()->get($this->groupName);
+       }
 }
index c5ed9b5d09839de65f4dfe5c10d28c6985a1ce6f..06ebce9015c7125f855ea9ac9c04002262b47efc 100644 (file)
@@ -62,7 +62,7 @@ class UserProfileVisitorAction extends AbstractDatabaseObjectAction implements I
                        ORDER BY        time DESC";
                $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
                $statement->execute(array($this->parameters['userID']));
-               $userIDs = $statement->fetchColumns();
+               $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                // create group
                $group = new GroupedUserList();
index 453181225695e73d06c7438ee1e7ff267e77e91f..c6d88d82d923f7d3a5e01bd4c8646da699461770 100644 (file)
@@ -495,7 +495,7 @@ class SearchForm extends AbstractCaptchaForm {
                                WHERE   username ".($this->nameExactly ? "= ?" : "LIKE ?");
                        $statement = WCF::getDB()->prepareStatement($sql, 100);
                        $statement->execute(array($this->username.(!$this->nameExactly ? '%' : '')));
-                       $userIDs = $statement->fetchColumns();
+                       $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                        
                        if (empty($userIDs)) {
                                $this->throwNoMatchesException();
index 04d6e7bf6b861bef3deddcfbab652a417d480e28..69903202460fde0a19548d38a5ab20bedb8bb201 100644 (file)
@@ -175,7 +175,7 @@ class UserSearchForm extends UserOptionListForm {
                // do search
                $statement = WCF::getDB()->prepareStatement($sql.$this->conditions, $this->maxResults);
                $statement->execute($this->conditions->getParameters());
-               $this->matches = $statement->fetchColumns();
+               $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
        }
        
        /**
index f7979d8fec26feda84b062aab4b388307b7a07ed..4fc04164c319ba114803e7b23a1aa17f6a00fe2e 100644 (file)
@@ -31,7 +31,7 @@ class AttachmentCleanUpCronjob extends AbstractCronjob {
                        0,
                        (TIME_NOW - 86400)
                ));
-               $attachmentIDs = $statement->fetchColumns();
+               $attachmentIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($attachmentIDs)) {
                        AttachmentEditor::deleteAll($attachmentIDs);
index dc1fe3cd3c3dd6be4fa0e213f287ca2b636c370b..5510a26e4f29723809527c9e0ed3517aadd8ef24 100644 (file)
@@ -43,7 +43,7 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                        TIME_NOW - 3600 * 23,
                        0
                ));
-               $userIDs = $statement->fetchColumns();
+               $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                if (empty($userIDs)) return;
                
                // get users
index 4171428aa6a1535c95bc1a7a132eaf226be03bdb..fbf9dee4640d94ccaf97587a1d4076bdc2e117b2 100644 (file)
@@ -32,7 +32,7 @@ class ModerationQueueCronjob extends AbstractCronjob {
                        ModerationQueue::STATUS_DONE,
                        (TIME_NOW - (86400 * 30))
                ));
-               $queueIDs = $statement->fetchColumns();
+               $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($queueIDs)) {
                        $conditions = new PreparedStatementConditionBuilder();
index f65050eab27c6224a91c596abedfcda03cf4de78..829fad90e1e06b1c70cdb61e27dca5dbb2eb42a9 100644 (file)
@@ -30,7 +30,7 @@ class UserQuitCronjob extends AbstractCronjob {
                        0,
                        (TIME_NOW - 7 * 24 * 3600)
                ));
-               $userIDs = $statement->fetchColumns();
+               $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($userIDs)) {
                        $action = new UserAction($userIDs, 'delete');
index 7d39de6c8adeb80cdc58b19304a864b3fb871aaa..ca872fd8e01fd935a5efff34098fb54241a4d5d1 100644 (file)
@@ -20,6 +20,7 @@ use wcf\system\WCF;
  * 
  * @method     boolean         closeCursor()
  * @method     mixed           fetch($fetch_style, $cursor_orientation = \PDO::FETCH_ORI_NEXT, $cursor_offset = 0)
+ * @method     array           fetchAll($fetch_style = \PDO::ATTR_DEFAULT_FETCH_MODE, $fetch_argument = null, $ctor_args = [])
  * @method     mixed           fetchColumn($column_number = 0)
  */
 class PreparedStatement {
@@ -159,21 +160,6 @@ class PreparedStatement {
                return $column;
        }
        
-       /**
-        * Returns a specific column for all of the remaining rows.
-        * 
-        * @param       integer         $columnNumber
-        * @return      array
-        */
-       public function fetchColumns($columnNumber = 0) {
-               $columns = [];
-               while ($column = $this->fetchColumn($columnNumber)) {
-                       $columns[] = $column;
-               }
-               
-               return $columns;
-       }
-       
        /**
         * Fetches the next row from a result set in a database object.
         * 
index 92de7cc17c03c0d57dc1f8a62e59ad6c23d6ca91..872c69f3841de0250e5d80811ccc6d496cdb4b74 100644 (file)
@@ -133,7 +133,7 @@ class EditHistoryManager extends SingletonFactory {
                        $userIDs
                ));
                
-               $entryIDs = $statement->fetchColumns();
+               $entryIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                if (empty($entryIDs)) return;
                
                $list = new EditHistoryEntryList();
index bcb05ec2925eaab5a709859b37f70a5cbff1afc3..87a704311c02687b3acb54ed86bb0fa1b4b0085b 100644 (file)
@@ -42,7 +42,7 @@ class AbstractCommentResponseImporter extends AbstractImporter {
                        ORDER BY        time ASC, responseID ASC";
                $statement = WCF::getDB()->prepareStatement($sql, 5);
                $statement->execute(array($response->commentID));
-               $responseIDs = $statement->fetchColumns();
+               $responseIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                // update parent comment
                $sql = "UPDATE  wcf".WCF_N."_comment
index 7b91f835de66d625cfa81716de8a76d3a78a37a7..aee9bf306f5949b0faaad22b6dec8521a51523b6 100644 (file)
@@ -49,7 +49,7 @@ class UserImporter extends AbstractImporter {
                        WHERE   preset = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute(array(1));
-               $this->eventIDs = $statement->fetchColumns();
+               $this->eventIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                $userOptionList = new UserOptionList();
                $userOptionList->readObjects();
index be94ea047416782ee419b9df1fa454e01e34e90d..6353beb685d3d5ed0af1bd05c6f205d47e538648 100644 (file)
@@ -89,7 +89,7 @@ abstract class AbstractModerationQueueHandler implements IModerationQueueHandler
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $queueIDs = $statement->fetchColumns();
+               $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($queueIDs)) {
                        $queueAction = new ModerationQueueAction($queueIDs, 'delete');
index d66ebbabbe15e107f6107e3f9dbe2dd70be72252..1cbf68af8f70e5c5e0f6d901b61c6948816bfb6b 100644 (file)
@@ -477,7 +477,7 @@ class PackageInstallationScheduler {
                                $package->package,
                                $match[1].'%'
                        ));
-                       $packageVersions = $statement->fetchColumns();
+                       $packageVersions = $statement->fetchAll(\PDO::FETCH_COLUMN);
                        
                        if (count($packageVersions) > 1) {
                                // sort by version number
index efc2f2bc69d6496641f038e2cee888391c76f538..848d8f8cee381030cdf297b4d84b058c70fa333d 100644 (file)
@@ -345,7 +345,7 @@ class BoxPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin
                                ".$conditionBuilder;
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($conditionBuilder->getParameters());
-                       $pageIDs = $statement->fetchColumns();
+                       $pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                        
                        // save page ids
                        foreach ($pageIDs as $pageID) {
index 0ae8e847c0f653b52457ceb50becc29f132ed367..204f34189d3ce00bec1f14086608128a324fead4 100644 (file)
@@ -258,7 +258,7 @@ class MenuPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin
                                        " . $conditionBuilder;
                                $statement = WCF::getDB()->prepareStatement($sql);
                                $statement->execute($conditionBuilder->getParameters());
-                               $pageIDs = $statement->fetchColumns();
+                               $pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                
                                // save page ids
                                foreach ($pageIDs as $pageID) {
index 0e390a87966c20c16ce5e01b7d513563a64ebb01..10a7569c9f9c6fe2bd2050e74b399af3db4b5abf 100644 (file)
@@ -628,7 +628,7 @@ class SessionHandler extends SingletonFactory {
                                WHERE   userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute(array($this->user->userID));
-                       $groupIDs = $statement->fetchColumns();
+                       $groupIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                }
                else {
                        $groupIDs = $this->user->getGroupIDs();
@@ -671,7 +671,7 @@ class SessionHandler extends SingletonFactory {
                                WHERE   userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute(array($this->user->userID));
-                       $this->languageIDs = $statement->fetchColumns();
+                       $this->languageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                }
                else {
                        $this->languageIDs = $this->user->getLanguageIDs();
index f5f28a51cc553240857e9432662532f2eb89309a..2e0d5ad4af6ba144355440dacaf484a966a6297f 100644 (file)
@@ -102,7 +102,7 @@ class UserCollapsibleContentHandler extends SingletonFactory {
                                                $objectTypeID,
                                                WCF::getUser()->userID
                                        ));
-                                       $this->collapsedContent[$objectTypeID] = $statement->fetchColumns();
+                                       $this->collapsedContent[$objectTypeID] = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                        
                                        // update storage data
                                        UserStorageHandler::getInstance()->update(WCF::getUser()->userID, 'collapsedContent-'.$objectTypeID, serialize($this->collapsedContent[$objectTypeID]));
index 15404ef42b0123fa1de88249de6f5314d692d76e..1dd365bfc20c9da1f6be5b7b2e5a9f97f08662ea 100644 (file)
@@ -156,7 +156,7 @@ class UserNotificationHandler extends SingletonFactory {
                                ".$conditions;
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($conditions->getParameters());
-                       $notificationIDs = $statement->fetchColumns();
+                       $notificationIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                        
                        // filter array of existing notifications and remove values which
                        // do not have a notification from this author yet (inverse logic!)
@@ -706,7 +706,7 @@ class UserNotificationHandler extends SingletonFactory {
                $statement->execute(array(
                        $objectTypeObj->objectTypeID
                ));
-               $eventIDs = $statement->fetchColumns();
+               $eventIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($eventIDs)) {
                        $conditions = new PreparedStatementConditionBuilder();
@@ -718,7 +718,7 @@ class UserNotificationHandler extends SingletonFactory {
                                ".$conditions;
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($conditions->getParameters());
-                       $userIDs = $statement->fetchColumns();
+                       $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                        
                        // reset number of notifications
                        if (!empty($userIDs)) {
index 2869de50b19580c7d722ef647979c9655b8a806e..91a70cbdc90438d62cd1a7d84e4451b3d98c5fbd 100644 (file)
@@ -63,7 +63,7 @@ trait TMultiRecipientModerationQueueCommentUserNotificationObjectType {
                        $comment->objectID,
                        $objectTypeID
                ]);
-               $recipientIDs = $statement->fetchColumns();
+               $recipientIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                // make sure that all users can (still) access the moderation queue entry
                if (!empty($recipientIDs)) {
@@ -76,7 +76,7 @@ trait TMultiRecipientModerationQueueCommentUserNotificationObjectType {
                                ".$conditionBuilder;
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($conditionBuilder->getParameters());
-                       $recipientIDs = $statement->fetchColumns();
+                       $recipientIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                        
                        // make sure that all users (still) have permission to access moderation
                        if (!$recipientIDs) {
index 23b2ccfddbec02c7215a92c3caf93f9e5260d8a4..a648c512e8cabaee796e0ad302111d647db2e03e 100644 (file)
@@ -61,7 +61,7 @@ class UserObjectWatchHandler extends SingletonFactory {
                        ".$conditionsBuilder;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditionsBuilder->getParameters());
-               $userIDs = $statement->fetchColumns();
+               $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($userIDs)) {
                        // reset user storage