Use DatabaseObjectList::setObjectIDs() wherever possible
authorMatthias Schmidt <gravatronics@live.com>
Sat, 8 Aug 2015 10:44:28 +0000 (12:44 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 8 Aug 2015 10:44:28 +0000 (12:44 +0200)
files/lib/data/conversation/ConversationEditor.class.php
files/lib/system/message/quote/ConversationMessageQuoteHandler.class.php
files/lib/system/search/ConversationMessageSearch.class.php

index 34c6244413b9daa27cd383592f0ffaf6d7352416..b07aa489f46b61508000f0bf84eb1c03ad70343a 100644 (file)
@@ -228,7 +228,7 @@ class ConversationEditor extends DatabaseObjectEditor {
         */
        public static function updateParticipantSummaries(array $conversationIDs) {
                $conversationList = new ConversationList();
-               $conversationList->getConditionBuilder()->add('conversation.conversationID IN (?)', array($conversationIDs));
+               $conversationList->setObjectIDs($conversationIDs);
                $conversationList->readObjects();
                
                foreach ($conversationList as $conversation) {
@@ -244,7 +244,7 @@ class ConversationEditor extends DatabaseObjectEditor {
         */
        public static function updateParticipantCounts(array $conversationIDs) {
                $conversationList = new ConversationList();
-               $conversationList->getConditionBuilder()->add('conversation.conversationID IN (?)', array($conversationIDs));
+               $conversationList->setObjectIDs($conversationIDs);
                $conversationList->readObjects();
                
                foreach ($conversationList as $conversation) {
index eddd09fd6368ee3e7354d5e615f51d2bf035715c..b1718de9eef702a0158e3296d2f2c5e36a42fce6 100644 (file)
@@ -20,7 +20,7 @@ class ConversationMessageQuoteHandler extends AbstractMessageQuoteHandler {
        protected function getMessages(array $data) {
                // read messages
                $messageList = new ConversationMessageList();
-               $messageList->getConditionBuilder()->add("conversation_message.messageID IN (?)", array(array_keys($data)));
+               $messageList->setObjectIDs(array_keys($data));
                $messageList->readObjects();
                $messages = $messageList->getObjects();
                
@@ -34,7 +34,7 @@ class ConversationMessageQuoteHandler extends AbstractMessageQuoteHandler {
                $quotedMessages = array();
                if (!empty($conversationIDs)) {
                        $conversationList = new ConversationList();
-                       $conversationList->getConditionBuilder()->add("conversation.conversationID IN (?)", array($conversationIDs));
+                       $conversationList->setObjectIDs($conversationIDs);
                        $conversationList->readObjects();
                        $conversations = $conversationList->getObjects();
                        
index 624824321dd685d270f6d115aaa8b60818280ae2..0d78631dfc1cdabd7966ec9a16d1f6ae9d4edcc4 100644 (file)
@@ -27,7 +27,7 @@ class ConversationMessageSearch extends AbstractSearchableObjectType {
         */
        public function cacheObjects(array $objectIDs, array $additionalData = null) {
                $messageList = new SearchResultConversationMessageList();
-               $messageList->getConditionBuilder()->add('conversation_message.messageID IN (?)', array($objectIDs));
+               $messageList->setObjectIDs($objectIDs);
                $messageList->readObjects();
                foreach ($messageList->getObjects() as $message) {
                        $this->messageCache[$message->messageID] = $message;