Commit | Line | Data |
---|---|---|
d7649d82 | 1 | <?php |
fea86294 | 2 | |
d7649d82 | 3 | namespace wcf\data\conversation; |
fea86294 | 4 | |
d7649d82 AE |
5 | use wcf\system\WCF; |
6 | ||
7 | /** | |
8 | * Represents a list of conversations for RSS feeds. | |
fca4cc72 | 9 | * |
fea86294 TD |
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 | |
d7649d82 | 19 | */ |
fea86294 TD |
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 | ||
fea86294 TD |
32 | /** |
33 | * @inheritDoc | |
34 | */ | |
35 | public function readObjectIDs() | |
36 | { | |
8fbd8b01 MS |
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 : ''); | |
fea86294 TD |
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 | } | |
d7649d82 | 58 | } |