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> | |
fea86294 TD |
13 | * |
14 | * @method FeedConversation current() | |
15 | * @method FeedConversation[] getObjects() | |
4aa8d544 | 16 | * @method FeedConversation|null getSingleObject() |
b3d76637 | 17 | * @method FeedConversation|null search($objectID) |
fea86294 | 18 | * @property FeedConversation[] $objects |
ba2cfa5a | 19 | * @deprecated 6.1 |
d7649d82 | 20 | */ |
fea86294 TD |
21 | class FeedConversationList extends ConversationList |
22 | { | |
23 | /** | |
24 | * @inheritDoc | |
25 | */ | |
26 | public $decoratorClassName = FeedConversation::class; | |
27 | ||
28 | /** | |
29 | * @inheritDoc | |
30 | */ | |
31 | public $sqlOrderBy = 'conversation.lastPostTime DESC'; | |
32 | ||
fea86294 TD |
33 | /** |
34 | * @inheritDoc | |
35 | */ | |
36 | public function readObjectIDs() | |
37 | { | |
8fbd8b01 MS |
38 | $sql = "SELECT conversation_to_user.conversationID AS objectID |
39 | FROM wcf" . WCF_N . "_conversation_to_user conversation_to_user | |
40 | " . $this->sqlConditionJoins . " | |
41 | " . $this->getConditionBuilder() . " | |
42 | " . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : ''); | |
fea86294 TD |
43 | $statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset); |
44 | $statement->execute($this->getConditionBuilder()->getParameters()); | |
45 | $this->objectIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); | |
46 | } | |
47 | ||
48 | /** | |
49 | * @inheritDoc | |
50 | */ | |
51 | public function readObjects() | |
52 | { | |
53 | if ($this->objectIDs === null) { | |
54 | $this->readObjectIDs(); | |
55 | } | |
56 | ||
57 | parent::readObjects(); | |
58 | } | |
d7649d82 | 59 | } |