3 namespace wcf\data\conversation\message
;
5 use wcf\data\conversation\Conversation
;
6 use wcf\data\search\ISearchResultObject
;
7 use wcf\system\request\LinkHandler
;
8 use wcf\system\search\SearchResultTextParser
;
11 * Represents a list of search result.
14 * @copyright 2001-2019 WoltLab GmbH
15 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
16 * @package WoltLabSuite\Core\Data\Conversation\Message
18 * @property-read string|null $subject
20 class SearchResultConversationMessage
extends ViewableConversationMessage
implements ISearchResultObject
28 /** @noinspection PhpMissingParentCallCommonInspection */
31 * Returns the conversation object.
33 * @return Conversation
35 public function getConversation()
37 if ($this->conversation
=== null) {
38 $this->conversation
= new Conversation(null, [
39 'conversationID' => $this->conversationID
,
40 'subject' => $this->subject
,
44 return $this->conversation
;
47 /** @noinspection PhpMissingParentCallCommonInspection */
52 public function getFormattedMessage()
54 return SearchResultTextParser
::getInstance()->parse(
55 $this->getDecoratedObject()->getSimplifiedFormattedMessage()
62 public function getSubject()
64 return $this->subject
;
70 public function getLink($query = '')
73 return LinkHandler
::getInstance()->getLink('Conversation', [
74 'object' => $this->getConversation(),
75 'messageID' => $this->messageID
,
76 'highlight' => \
urlencode($query),
77 ], '#message' . $this->messageID
);
80 return $this->getDecoratedObject()->getLink();
83 /** @noinspection PhpMissingParentCallCommonInspection */
88 public function getTime()
96 public function getObjectTypeName()
98 return 'com.woltlab.wcf.conversation.message';
104 public function getContainerTitle()
112 public function getContainerLink()