Add @method documentation for DatabaseObjectList implementations
authorMatthias Schmidt <gravatronics@live.com>
Tue, 10 May 2016 17:44:19 +0000 (19:44 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 10 May 2016 17:44:19 +0000 (19:44 +0200)
files/lib/data/conversation/ConversationList.class.php
files/lib/data/conversation/FeedConversationList.class.php
files/lib/data/conversation/UserConversationList.class.php
files/lib/data/conversation/label/ConversationLabelList.class.php
files/lib/data/conversation/message/ConversationMessageList.class.php
files/lib/data/conversation/message/SearchResultConversationMessageList.class.php
files/lib/data/conversation/message/ViewableConversationMessageList.class.php
files/lib/data/modification/log/ConversationLogModificationLogList.class.php

index 53027b182432ad443ef0e3f4df65b32b229228de..937ac58d521812720a2da6ddcf809b414a595c3d 100644 (file)
@@ -11,6 +11,10 @@ use wcf\data\DatabaseObjectList;
  * @package    com.woltlab.wcf.conversation
  * @subpackage data.conversation
  * @category   Community Framework
+ *
+ * @method     Conversation            current()
+ * @method     Conversation[]          getObjects()
+ * @method     Conversation|null       search($objectID)
  */
 class ConversationList extends DatabaseObjectList {
        /**
index afc0c7ad5211a317bd45d6ffbf254c42f33d6bd3..9b6d90dbe81ebbe9019fc79ea7d710fed92d331b 100644 (file)
@@ -6,25 +6,29 @@ use wcf\system\WCF;
  * Represents a list of conversations for RSS feeds.
  * 
  * @author     Alexander Ebert
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf.conversation
  * @subpackage data.conversation
  * @category   Community Framework
+ *
+ * @method     FeedConversation        current()
+ * @method     FeedConversation[]      getObjects()
+ * @method     FeedConversation|null   search($objectID)
  */
 class FeedConversationList extends ConversationList {
        /**
-        * @see \wcf\data\DatabaseObjectList::$decoratorClassName
+        * @inheritDoc
         */
-       public $decoratorClassName = 'wcf\data\conversation\FeedConversation';
+       public $decoratorClassName = FeedConversation::class;
        
        /**
-        * @see \wcf\data\DatabaseObjectList::$sqlOrderBy
+        * @inheritDoc
         */
        public $sqlOrderBy = 'conversation.lastPostTime DESC';
        
        /**
-        * @see \wcf\data\DatabaseObjectList::readObjectIDs()
+        * @inheritDoc
         */
        public function readObjectIDs() {
                $sql = "SELECT  conversation_to_user.conversationID AS objectID
@@ -38,7 +42,7 @@ class FeedConversationList extends ConversationList {
        }
        
        /**
-        * @see \wcf\data\DatabaseObjectList::readObjects()
+        * @inheritDoc
         */
        public function readObjects() {
                if ($this->objectIDs === null) {
index fb8506cdf0cdb8bb34e45c87bef6e3daeb3c86ab..ae09f369ec97ce5afc5c34bd8593b37421ff5e3e 100644 (file)
@@ -15,13 +15,17 @@ use wcf\system\WCF;
  * @package    com.woltlab.wcf.conversation
  * @subpackage data.conversation
  * @category   Community Framework
+ * 
+ * @method     ViewableConversation            current()
+ * @method     ViewableConversation[]          getObjects()
+ * @method     ViewableConversation|null       search($objectID)
  */
 class UserConversationList extends ConversationList {
        /**
         * list of available filters
         * @var string[]
         */
-       public static $availableFilters = array('hidden', 'draft', 'outbox');
+       public static $availableFilters = ['hidden', 'draft', 'outbox'];
        
        /**
         * active filter
@@ -31,14 +35,14 @@ class UserConversationList extends ConversationList {
        
        /**
         * label list object
-        * @var \wcf\data\conversation\label\ConversationLabelList
+        * @var ConversationLabelList
         */
        public $labelList = null;
        
        /**
-        * @see \wcf\data\DatabaseObjectList::$decoratorClassName
+        * @inheritDoc
         */
-       public $decoratorClassName = 'wcf\data\conversation\ViewableConversation';
+       public $decoratorClassName = ViewableConversation::class;
        
        /**
         * Creates a new UserConversationList
@@ -54,14 +58,14 @@ class UserConversationList extends ConversationList {
                
                // apply filter
                if ($this->filter == 'draft') {
-                       $this->getConditionBuilder()->add('conversation.userID = ?', array($userID));
+                       $this->getConditionBuilder()->add('conversation.userID = ?', [$userID]);
                        $this->getConditionBuilder()->add('conversation.isDraft = 1');
                }
                else {
-                       $this->getConditionBuilder()->add('conversation_to_user.participantID = ?', array($userID));
-                       $this->getConditionBuilder()->add('conversation_to_user.hideConversation = ?', array(($this->filter == 'hidden' ? 1 : 0)));
+                       $this->getConditionBuilder()->add('conversation_to_user.participantID = ?', [$userID]);
+                       $this->getConditionBuilder()->add('conversation_to_user.hideConversation = ?', [($this->filter == 'hidden' ? 1 : 0)]);
                        $this->sqlConditionJoins = "LEFT JOIN wcf".WCF_N."_conversation conversation ON (conversation.conversationID = conversation_to_user.conversationID)";
-                       if ($this->filter == 'outbox') $this->getConditionBuilder()->add('conversation.userID = ?', array($userID));
+                       if ($this->filter == 'outbox') $this->getConditionBuilder()->add('conversation.userID = ?', [$userID]);
                }
                
                // filter by label id
@@ -70,7 +74,7 @@ class UserConversationList extends ConversationList {
                                SELECT  conversationID
                                FROM    wcf".WCF_N."_conversation_label_to_object
                                WHERE   labelID = ?
-                       )", array($labelID));
+                       )", [$labelID]);
                }
                
                // own posts
@@ -86,14 +90,14 @@ class UserConversationList extends ConversationList {
        /**
         * Sets the label list of the user the conversations belong to.
         * 
-        * @param       \wcf\data\conversation\label\ConversationLabelList      $labelList
+        * @param       ConversationLabelList   $labelList
         */
        public function setLabelList(ConversationLabelList $labelList) {
                $this->labelList = $labelList;
        }
        
        /**
-        * @see \wcf\data\DatabaseObjectList::countObjects()
+        * @inheritDoc
         */
        public function countObjects() {
                if ($this->filter == 'draft') return parent::countObjects();
@@ -109,7 +113,7 @@ class UserConversationList extends ConversationList {
        }
        
        /**
-        * @see \wcf\data\DatabaseObjectList::readObjectIDs()
+        * @inheritDoc
         */
        public function readObjectIDs() {
                if ($this->filter == 'draft') {
@@ -129,7 +133,7 @@ class UserConversationList extends ConversationList {
        }
        
        /**
-        * @see \wcf\data\DatabaseObjectList::readObjects()
+        * @inheritDoc
         */
        public function readObjects() {
                if ($this->objectIDs === null) {
@@ -184,22 +188,22 @@ class UserConversationList extends ConversationList {
        protected function loadLabelAssignments() {
                $labels = $this->getLabels();
                if (empty($labels)) {
-                       return array();
+                       return [];
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("conversationID IN (?)", array(array_keys($this->objects)));
-               $conditions->add("labelID IN (?)", array(array_keys($labels)));
+               $conditions->add("conversationID IN (?)", [array_keys($this->objects)]);
+               $conditions->add("labelID IN (?)", [array_keys($labels)]);
                
                $sql = "SELECT  labelID, conversationID
                        FROM    wcf".WCF_N."_conversation_label_to_object
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $data = array();
+               $data = [];
                while ($row = $statement->fetchArray()) {
                        if (!isset($data[$row['conversationID']])) {
-                               $data[$row['conversationID']] = array();
+                               $data[$row['conversationID']] = [];
                        }
                        
                        $data[$row['conversationID']][$row['labelID']] = $labels[$row['labelID']];
index 197941125a1cb86f35b97ec0f6a4969870b7ab7b..423341795e9b6b571c5f8c0a6d4f742b711afb75 100644 (file)
@@ -6,15 +6,19 @@ use wcf\data\DatabaseObjectList;
  * Represents a list of conversation labels.
  * 
  * @author     Marcel Werk
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf.conversation
  * @subpackage data.conversation.label
  * @category   Community Framework
+ * 
+ * @method     ConversationLabel               current()
+ * @method     ConversationLabel[]             getObjects()
+ * @method     ConversationLabel|null          search($objectID)
  */
 class ConversationLabelList extends DatabaseObjectList {
        /**
-        * @see \wcf\data\DatabaseObjectList::$className
+        * @inheritDoc
         */
-       public $className = 'wcf\data\conversation\label\ConversationLabel';
+       public $className = ConversationLabel::class;
 }
index 348f409bd34cea56faddb3be935bf5af501686e0..9d620dd98491cc90a4e1bf75c0190edf5303b66c 100644 (file)
@@ -6,15 +6,19 @@ use wcf\data\DatabaseObjectList;
  * Represents a list of conversation messages.
  * 
  * @author     Marcel Werk
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf.conversation
  * @subpackage data.conversation.message
  * @category   Community Framework
+ *
+ * @method     ConversationMessage             current()
+ * @method     ConversationMessage[]           getObjects()
+ * @method     ConversationMessage|null        search($objectID)
  */
 class ConversationMessageList extends DatabaseObjectList {
        /**
-        * @see \wcf\data\DatabaseObjectList::$className
+        * @inheritDoc
         */
-       public $className = 'wcf\data\conversation\message\ConversationMessage';
+       public $className = ConversationMessage::class;
 }
index daacca02aa4911634f55636fb200ab33f0d8b744..afd377c3c9f8fe509934f907b9316489a5fc2daf 100644 (file)
@@ -5,17 +5,21 @@ namespace wcf\data\conversation\message;
  * Represents a list of search results.
  * 
  * @author     Marcel Werk
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf.conversation
  * @subpackage data.conversation.message
  * @category   Community Framework
+ *
+ * @method     SearchResultConversationMessage         current()
+ * @method     SearchResultConversationMessage[]       getObjects()
+ * @method     SearchResultConversationMessage|null    search($objectID)
  */
 class SearchResultConversationMessageList extends SimplifiedViewableConversationMessageList {
        /**
-        * @see \wcf\data\DatabaseObjectList::$decoratorClassName
+        * @inheritDoc
         */
-       public $decoratorClassName = 'wcf\data\conversation\message\SearchResultConversationMessage';
+       public $decoratorClassName = SearchResultConversationMessage::class;
        
        /**
         * Creates a new SearchResultConversationMessageList object.
index ebd42a63c5eaf1cbc4dcede2fe583f5f2b6e83fc..8914a48414fab624cbdff67e776689fb54170022 100644 (file)
@@ -10,38 +10,42 @@ use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
  * Represents a list of viewable conversation messages.
  * 
  * @author     Marcel Werk
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf.conversation
  * @subpackage data.conversation.message
  * @category   Community Framework
+ *
+ * @method     ViewableConversationMessage             current()
+ * @method     ViewableConversationMessage[]           getObjects()
+ * @method     ViewableConversationMessage|null        search($objectID)
  */
 class ViewableConversationMessageList extends ConversationMessageList {
        /**
-        * @see \wcf\data\DatabaseObjectList::$sqlOrderBy
+        * @inheritDoc
         */
        public $sqlOrderBy = 'conversation_message.time';
        
        /**
-        * @see \wcf\data\DatabaseObjectList::$decoratorClassName
+        * @inheritDoc
         */
-       public $decoratorClassName = 'wcf\data\conversation\message\ViewableConversationMessage';
+       public $decoratorClassName = ViewableConversationMessage::class;
        
        /**
         * attachment object ids
         * @var integer[]
         */
-       public $attachmentObjectIDs = array();
+       public $attachmentObjectIDs = [];
        
        /**
         * ids of the messages with embedded objects
         * @var integer[]
         */
-       public $embeddedObjectMessageIDs = array();
+       public $embeddedObjectMessageIDs = [];
        
        /**
         * attachment list
-        * @var \wcf\data\attachment\GroupedAttachmentList
+        * @var GroupedAttachmentList
         */
        protected $attachmentList = null;
        
@@ -65,12 +69,12 @@ class ViewableConversationMessageList extends ConversationMessageList {
        
        /**
         * conversation object
-        * @var \wcf\data\conversation\Conversation
+        * @var Conversation
         */
        protected $conversation = null;
        
        /**
-        * @see \wcf\data\DatabaseObjectList::readObjects()
+        * @inheritDoc
         */
        public function readObjects() {
                if ($this->objectIDs === null) {
@@ -131,7 +135,7 @@ class ViewableConversationMessageList extends ConversationMessageList {
        public function readAttachments() {
                if (MODULE_ATTACHMENT == 1 && !empty($this->attachmentObjectIDs)) {
                        $this->attachmentList = new GroupedAttachmentList('com.woltlab.wcf.conversation.message');
-                       $this->attachmentList->getConditionBuilder()->add('attachment.objectID IN (?)', array($this->attachmentObjectIDs));
+                       $this->attachmentList->getConditionBuilder()->add('attachment.objectID IN (?)', [$this->attachmentObjectIDs]);
                        $this->attachmentList->readObjects();
                }
        }
@@ -148,7 +152,7 @@ class ViewableConversationMessageList extends ConversationMessageList {
        /**
         * Returns the list of attachments.
         * 
-        * @return      \wcf\data\attachment\GroupedAttachmentList
+        * @return      GroupedAttachmentList
         */
        public function getAttachmentList() {
                return $this->attachmentList;
@@ -175,7 +179,7 @@ class ViewableConversationMessageList extends ConversationMessageList {
        /**
         * Sets active conversation.
         * 
-        * @param       \wcf\data\conversation\Conversation             $conversation
+        * @param       Conversation            $conversation
         */
        public function setConversation(Conversation $conversation) {
                $this->conversation = $conversation;
index e4f9d15f338a19014768ab2ece3b8747b79ac166..259c43150753cd84609269ea7655c07cf19252c6 100644 (file)
@@ -8,11 +8,15 @@ use wcf\system\WCF;
  * Represents a list of modification logs for conversation log page.
  * 
  * @author     Alexander Ebert
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf.conversation
  * @subpackage data.modification.log
  * @category   Community Framework
+ *
+ * @method     ViewableConversationModificationLog             current()
+ * @method     ViewableConversationModificationLog[]           getObjects()
+ * @method     ViewableConversationModificationLog|null        search($objectID)
  */
 class ConversationLogModificationLogList extends ModificationLogList {
        /**