Commit | Line | Data |
---|---|---|
d7649d82 | 1 | <?php |
fea86294 | 2 | |
d7649d82 | 3 | namespace wcf\data\conversation; |
fea86294 | 4 | |
d7649d82 AE |
5 | use wcf\data\DatabaseObjectDecorator; |
6 | use wcf\data\IFeedEntry; | |
7 | use wcf\system\request\LinkHandler; | |
8 | ||
9 | /** | |
10 | * Represents a conversation for RSS feeds. | |
b41c9fd6 | 11 | * |
fea86294 TD |
12 | * @author Alexander Ebert |
13 | * @copyright 2001-2019 WoltLab GmbH | |
14 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> | |
fea86294 TD |
15 | * |
16 | * @method Conversation getDecoratedObject() | |
17 | * @mixin Conversation | |
ba2cfa5a | 18 | * @deprecated 6.1 |
d7649d82 | 19 | */ |
fea86294 TD |
20 | class FeedConversation extends DatabaseObjectDecorator implements IFeedEntry |
21 | { | |
22 | /** | |
23 | * @inheritDoc | |
24 | */ | |
25 | protected static $baseClass = Conversation::class; | |
26 | ||
27 | /** | |
28 | * @inheritDoc | |
29 | */ | |
beb426fe | 30 | public function getLink(): string |
fea86294 TD |
31 | { |
32 | return LinkHandler::getInstance()->getLink('Conversation', [ | |
33 | 'object' => $this->getDecoratedObject(), | |
34 | 'encodeTitle' => true, | |
35 | ]); | |
36 | } | |
37 | ||
38 | /** | |
39 | * @inheritDoc | |
40 | */ | |
beb426fe | 41 | public function getTitle(): string |
fea86294 TD |
42 | { |
43 | return $this->getDecoratedObject()->getTitle(); | |
44 | } | |
45 | ||
46 | /** | |
47 | * @inheritDoc | |
48 | */ | |
beb426fe | 49 | public function getFormattedMessage(): string |
fea86294 TD |
50 | { |
51 | return ''; | |
52 | } | |
53 | ||
54 | /** | |
55 | * @inheritDoc | |
56 | */ | |
beb426fe | 57 | public function getMessage(): string |
fea86294 TD |
58 | { |
59 | return ''; | |
60 | } | |
61 | ||
62 | /** | |
63 | * @inheritDoc | |
64 | */ | |
beb426fe | 65 | public function getExcerpt($maxLength = 255): string |
fea86294 TD |
66 | { |
67 | return ''; | |
68 | } | |
69 | ||
70 | /** | |
71 | * @inheritDoc | |
72 | */ | |
73 | public function getUserID() | |
74 | { | |
75 | return $this->getDecoratedObject()->lastPosterID; | |
76 | } | |
77 | ||
78 | /** | |
79 | * @inheritDoc | |
80 | */ | |
beb426fe | 81 | public function getUsername(): string |
fea86294 TD |
82 | { |
83 | return $this->getDecoratedObject()->lastPoster; | |
84 | } | |
85 | ||
86 | /** | |
87 | * @inheritDoc | |
88 | */ | |
89 | public function getTime() | |
90 | { | |
91 | return $this->getDecoratedObject()->lastPostTime; | |
92 | } | |
93 | ||
94 | /** | |
95 | * @inheritDoc | |
96 | */ | |
beb426fe | 97 | public function __toString(): string |
fea86294 TD |
98 | { |
99 | return $this->getFormattedMessage(); | |
100 | } | |
101 | ||
102 | /** | |
103 | * @inheritDoc | |
104 | */ | |
105 | public function getComments() | |
106 | { | |
107 | return $this->replies; | |
108 | } | |
109 | ||
110 | /** | |
111 | * @inheritDoc | |
112 | */ | |
113 | public function getCategories() | |
114 | { | |
115 | return []; | |
116 | } | |
117 | ||
118 | /** | |
119 | * @inheritDoc | |
120 | */ | |
121 | public function isVisible() | |
122 | { | |
123 | return $this->canRead(); | |
124 | } | |
d7649d82 | 125 | } |