* @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 {
/**
* 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
}
/**
- * @see \wcf\data\DatabaseObjectList::readObjects()
+ * @inheritDoc
*/
public function readObjects() {
if ($this->objectIDs === null) {
* @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
/**
* 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
// 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
SELECT conversationID
FROM wcf".WCF_N."_conversation_label_to_object
WHERE labelID = ?
- )", array($labelID));
+ )", [$labelID]);
}
// own posts
/**
* 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();
}
/**
- * @see \wcf\data\DatabaseObjectList::readObjectIDs()
+ * @inheritDoc
*/
public function readObjectIDs() {
if ($this->filter == 'draft') {
}
/**
- * @see \wcf\data\DatabaseObjectList::readObjects()
+ * @inheritDoc
*/
public function readObjects() {
if ($this->objectIDs === null) {
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']];
* 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;
}
* 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;
}
* 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.
* 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;
/**
* 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) {
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();
}
}
/**
* Returns the list of attachments.
*
- * @return \wcf\data\attachment\GroupedAttachmentList
+ * @return GroupedAttachmentList
*/
public function getAttachmentList() {
return $this->attachmentList;
/**
* Sets active conversation.
*
- * @param \wcf\data\conversation\Conversation $conversation
+ * @param Conversation $conversation
*/
public function setConversation(Conversation $conversation) {
$this->conversation = $conversation;
* 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 {
/**