Reformat SQL queries using spaces
[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 /**
33 * @inheritDoc
34 */
35 public function readObjectIDs()
36 {
37 $sql = "SELECT conversation_to_user.conversationID AS objectID
38 FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user
39 " . $this->sqlConditionJoins . "
40 " . $this->getConditionBuilder() . "
41 " . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : '');
42 $statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset);
43 $statement->execute($this->getConditionBuilder()->getParameters());
44 $this->objectIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
45 }
46
47 /**
48 * @inheritDoc
49 */
50 public function readObjects()
51 {
52 if ($this->objectIDs === null) {
53 $this->readObjectIDs();
54 }
55
56 parent::readObjects();
57 }
58 }