9f9c54f7b74bec3793f0e5ca3268b1aa05bc2015
[GitHub/WoltLab/com.woltlab.wcf.conversation.git] / files / lib / data / conversation / FeedConversationList.class.php
1 <?php
2
3 namespace wcf\data\conversation;
4
5 use wcf\system\WCF;
6
7 /**
8 * Represents a list of conversations for RSS feeds.
9 *
10 * @author Alexander Ebert
11 * @copyright 2001-2019 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @package WoltLabSuite\Core\Data\Conversation
14 *
15 * @method FeedConversation current()
16 * @method FeedConversation[] getObjects()
17 * @method FeedConversation|null search($objectID)
18 * @property FeedConversation[] $objects
19 */
20 class FeedConversationList extends ConversationList
21 {
22 /**
23 * @inheritDoc
24 */
25 public $decoratorClassName = FeedConversation::class;
26
27 /**
28 * @inheritDoc
29 */
30 public $sqlOrderBy = 'conversation.lastPostTime DESC';
31
32 /** @noinspection PhpMissingParentCallCommonInspection */
33
34 /**
35 * @inheritDoc
36 */
37 public function readObjectIDs()
38 {
39 $sql = "SELECT conversation_to_user.conversationID AS objectID
40 FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user
41 " . $this->sqlConditionJoins . "
42 " . $this->getConditionBuilder() . "
43 " . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : '');
44 $statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset);
45 $statement->execute($this->getConditionBuilder()->getParameters());
46 $this->objectIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
47 }
48
49 /**
50 * @inheritDoc
51 */
52 public function readObjects()
53 {
54 if ($this->objectIDs === null) {
55 $this->readObjectIDs();
56 }
57
58 parent::readObjects();
59 }
60 }