Use DatabaseObjectList::setObjects() wherever possible
authorMatthias Schmidt <gravatronics@live.com>
Sun, 24 May 2015 10:12:47 +0000 (12:12 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 24 May 2015 10:12:47 +0000 (12:12 +0200)
16 files changed:
wcfsetup/install/files/lib/data/ad/AdAction.class.php
wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php
wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php
wcfsetup/install/files/lib/data/comment/StructuredCommentList.class.php
wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php
wcfsetup/install/files/lib/data/notice/NoticeAction.class.php
wcfsetup/install/files/lib/data/user/User.class.php
wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php
wcfsetup/install/files/lib/system/moderation/queue/report/CommentCommentModerationQueueReportHandler.class.php
wcfsetup/install/files/lib/system/moderation/queue/report/CommentResponseModerationQueueReportHandler.class.php
wcfsetup/install/files/lib/system/poll/PollManager.class.php
wcfsetup/install/files/lib/system/user/activity/event/FollowUserActivityEvent.class.php
wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentResponseUserActivityEvent.class.php
wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php
wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php
wcfsetup/install/files/lib/system/user/online/location/UserLocation.class.php

index 512eaf1956de63b4e9ec3aeca6103e9a605e8984..0f33a5158a43f8270c97463e019e892aaf21aa10 100644 (file)
@@ -88,7 +88,7 @@ class AdAction extends AbstractDatabaseObjectAction implements ISortableAction,
                }
                
                $adList = new AdList();
-               $adList->getConditionBuilder()->add('ad.adID IN (?)', array($this->parameters['data']['structure'][0]));
+               $adList->setObjectIDs($this->parameters['data']['structure'][0]);
                if ($adList->countObjects() != count($this->parameters['data']['structure'][0])) {
                        throw new UserInputException('structure');
                }
index 7e0c53160ed314d8798d7572afa3122409be93b7..03fbebf93319da5ab96ef62d5dab60bb659f5246 100644 (file)
@@ -261,7 +261,7 @@ class AttachmentAction extends AbstractDatabaseObjectAction {
                        
                        // get attachments from database (check thumbnail status)
                        $attachmentList = new AttachmentList();
-                       $attachmentList->getConditionBuilder()->add('attachment.attachmentID IN (?)', array($attachmentIDs));
+                       $attachmentList->setObjectIDs($attachmentIDs);
                        $attachmentList->readObjects();
                        
                        foreach ($attachmentList as $attachment) {
index de9207520d434b20b2ec0eb52880ccb85b5d1129..000b678be0b743ec95862308015c97b9a444803a 100644 (file)
@@ -53,7 +53,7 @@ class LikeableCommentProvider extends AbstractObjectTypeProvider implements ILik
                
                // fetch comments
                $commentList = new CommentList();
-               $commentList->getConditionBuilder()->add("comment.commentID IN (?)", array($commentIDs));
+               $commentList->setObjectIDs($commentIDs);
                $commentList->readObjects();
                $comments = $commentList->getObjects();
                
index 09afb061eb0cb1d4541795dc90af9d5bb03cd7dc..e4c2b826f0b89970874838f8fc0c1ac13f815e92 100644 (file)
@@ -105,7 +105,7 @@ class StructuredCommentList extends CommentList {
                // fetch last responses
                if (!empty($responseIDs)) {
                        $responseList = new CommentResponseList();
-                       $responseList->getConditionBuilder()->add("comment_response.responseID IN (?)", array(array_keys($responseIDs)));
+                       $responseList->setObjectIDs(array_keys($responseIDs));
                        $responseList->readObjects();
                        
                        foreach ($responseList as $response) {
index d71359f2a840eb9eefab5e7359f35b471fc6bbe4..9fa7ccd7dc66be00dd91a8849bb7d0cfddc03671 100644 (file)
@@ -66,7 +66,7 @@ class CommentResponseAction extends AbstractDatabaseObjectAction {
                }
                
                $commentList = new CommentList();
-               $commentList->getConditionBuilder()->add("comment.commentID IN (?)", array($commentIDs));
+               $commentList->setObjectIDs($commentIDs);
                $commentList->readObjects();
                $comments = $commentList->getObjects();
                
index 165ca3a3bc42b1e3ab7b42f9e51aa4787ed4c64a..dd81cf86179b2732342dd471008aec50e403f576 100644 (file)
@@ -139,7 +139,7 @@ class NoticeAction extends AbstractDatabaseObjectAction implements ISortableActi
                }
                
                $noticeList = new NoticeList();
-               $noticeList->getConditionBuilder()->add('notice.noticeID IN (?)', array($this->parameters['data']['structure'][0]));
+               $noticeList->setObjectIDs($this->parameters['data']['structure'][0]);
                if ($noticeList->countObjects() != count($this->parameters['data']['structure'][0])) {
                        throw new UserInputException('structure');
                }
index d06f1fe2ed9652b7428e4a5e74840889b8ba0964..59fca7298e61f6ebc054b781399bb920f7345a87 100644 (file)
@@ -355,7 +355,7 @@ final class User extends DatabaseObject implements IRouteController, IUserConten
         */
        public static function getUsers(array $userIDs) {
                $userList = new UserList();
-               $userList->getConditionBuilder()->add("user_table.userID IN (?)", array($userIDs));
+               $userList->setObjectIDs($userIDs);
                $userList->readObjects();
                
                return $userList->getObjects();
index 25ea761ed7b1039f685ef8468e66acc25ee911ac..54910c76176585de05267a062f6405e3f2817c84 100644 (file)
@@ -149,7 +149,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
                $userIDs = $responses = array();
                if (!empty($responseIDs)) {
                        $responseList = new CommentResponseList();
-                       $responseList->getConditionBuilder()->add("comment_response.responseID IN (?)", array($responseIDs));
+                       $responseList->setObjectIDs($responseIDs);
                        $responseList->readObjects();
                        $responses = $responseList->getObjects();
                        
@@ -163,7 +163,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
                
                // fetch comments
                $commentList = new CommentList();
-               $commentList->getConditionBuilder()->add("comment.commentID IN (?)", array($commentIDs));
+               $commentList->setObjectIDs($commentIDs);
                $commentList->readObjects();
                $comments = $commentList->getObjects();
                
index 364990a16e0e8a70b26d76d38b0261b117eed969..dd6138204ac738100fe4581dd53c80c16d7b7a2e 100644 (file)
@@ -190,7 +190,7 @@ class CommentCommentModerationQueueReportHandler extends AbstractModerationQueue
                
                // fetch comments
                $commentList = new CommentList();
-               $commentList->getConditionBuilder()->add("comment.commentID IN (?)", array($objectIDs));
+               $commentList->setObjectIDs($objectIDs);
                $commentList->readObjects();
                $comments = $commentList->getObjects();
                
index 64de213ac378940b0a0b2478835aae1b940357d6..af4e75a645b8cd626c1d0640edf65c832aad3d50 100644 (file)
@@ -169,7 +169,7 @@ class CommentResponseModerationQueueReportHandler extends CommentCommentModerati
                
                // fetch responses
                $responseList = new CommentResponseList();
-               $responseList->getConditionBuilder()->add("comment_response.responseID IN (?)", array($objectIDs));
+               $responseList->setObjectIDs($objectIDs);
                $responseList->readObjects();
                $responses = $responseList->getObjects();
                
@@ -181,7 +181,7 @@ class CommentResponseModerationQueueReportHandler extends CommentCommentModerati
                
                if (!empty($commentIDs)) {
                        $commentList = new CommentList();
-                       $commentList->getConditionBuilder()->add("comment.commentID IN (?)", array($commentIDs));
+                       $commentList->setObjectIDs($commentIDs);
                        $commentList->readObjects();
                        $comments = $commentList->getObjects();
                }
index dd7898374cde069b0bfa2476f7f693b6c9973e8f..d8ef0ee515d9a143bba323ed9d70bdc3f12e1f78 100644 (file)
@@ -327,7 +327,7 @@ class PollManager extends SingletonFactory {
         */
        public function getPolls(array $pollIDs) {
                $pollList = new PollList();
-               $pollList->getConditionBuilder()->add("poll.pollID IN (?)", array($pollIDs));
+               $pollList->setObjectIDs($pollIDs);
                $pollList->readObjects();
                $polls = $pollList->getObjects();
                
index 47aebc89d986785ccf74965712469c5e19af35ed..9b30d3a074602073840f33258d7e9cd8b7c4b1a2 100644 (file)
@@ -26,7 +26,7 @@ class FollowUserActivityEvent extends SingletonFactory implements IUserActivityE
                
                // fetch user id and username
                $userList = new UserList();
-               $userList->getConditionBuilder()->add("user_table.userID IN (?)", array($objectIDs));
+               $userList->setObjectIDs($objectIDs);
                $userList->readObjects();
                $users = $userList->getObjects();
                
index 460134eeff7d8369acbb7396b3e21d693d891367..a9a58be2234b0d04f7f50130a01f781fc7162a84 100644 (file)
@@ -33,7 +33,7 @@ class ProfileCommentResponseUserActivityEvent extends SingletonFactory implement
                
                // fetch responses
                $responseList = new CommentResponseList();
-               $responseList->getConditionBuilder()->add("comment_response.responseID IN (?)", array($responseIDs));
+               $responseList->setObjectIDs($responseIDs);
                $responseList->readObjects();
                $responses = $responseList->getObjects();
                
@@ -44,7 +44,7 @@ class ProfileCommentResponseUserActivityEvent extends SingletonFactory implement
                }
                if (!empty($commentIDs)) {
                        $commentList = new CommentList();
-                       $commentList->getConditionBuilder()->add("comment.commentID IN (?)", array($commentIDs));
+                       $commentList->setObjectIDs($commentIDs);
                        $commentList->readObjects();
                        $comments = $commentList->getObjects();
                }
@@ -57,7 +57,7 @@ class ProfileCommentResponseUserActivityEvent extends SingletonFactory implement
                }
                if (!empty($userIDs)) {
                        $userList = new UserProfileList();
-                       $userList->getConditionBuilder()->add("user_table.userID IN (?)", array($userIDs));
+                       $userList->setObjectIDs($userIDs);
                        $userList->readObjects();
                        $users = $userList->getObjects();
                }
index 2dfabb8572dd9e8ebaa7268da80d67d265d371fb..068e439a2b2987f95fd72720212270ccd1706011 100644 (file)
@@ -32,7 +32,7 @@ class ProfileCommentUserActivityEvent extends SingletonFactory implements IUserA
                
                // fetch comments
                $commentList = new CommentList();
-               $commentList->getConditionBuilder()->add("comment.commentID IN (?)", array($commentIDs));
+               $commentList->setObjectIDs($commentIDs);
                $commentList->readObjects();
                $comments = $commentList->getObjects();
                
@@ -43,7 +43,7 @@ class ProfileCommentUserActivityEvent extends SingletonFactory implements IUserA
                }
                if (!empty($userIDs)) {
                        $userList = new UserProfileList();
-                       $userList->getConditionBuilder()->add("user_table.userID IN (?)", array($userIDs));
+                       $userList->setObjectIDs($userIDs);
                        $userList->readObjects();
                        $users = $userList->getObjects();
                }
index e1754463f003a8dad3a9220c574348c8e7f8db21..595c560adb7098dfc393b17832cccde05b63a8e4 100644 (file)
@@ -37,7 +37,7 @@ class UserGroupAssignmentHandler extends SingletonFactory {
                if (empty($userIDs)) return;
                
                $userList = new UserList();
-               $userList->getConditionBuilder()->add('user_table.userID IN (?)', array($userIDs));
+               $userList->setObjectIDs($userIDs);
                $userList->readObjects();
                
                $assignments = UserGroupAssignmentCacheBuilder::getInstance()->getData();
index 06e8027b34a167f16133c8f316e41e73680956d1..9744b8bb23a2d99494a903250d92b847a17d520d 100644 (file)
@@ -59,7 +59,7 @@ class UserLocation implements IUserOnlineLocation {
                $this->userIDs = array_unique($this->userIDs);
                
                $userList = new UserList();
-               $userList->getConditionBuilder()->add('user_table.userID IN (?)', array($this->userIDs));
+               $userList->setObjectIDs($this->userIDs);
                $userList->readObjects();
                $this->users = $userList->getObjects();
        }