3 namespace wcf\data\modification\log
;
5 use wcf\data\DatabaseObjectDecorator
;
6 use wcf\data\TLegacyUserPropertyAccess
;
7 use wcf\data\user\UserProfile
;
8 use wcf\system\cache\runtime\UserProfileRuntimeCache
;
12 * Provides a viewable conversation modification log.
14 * @author Alexander Ebert
15 * @copyright 2001-2019 WoltLab GmbH
16 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
17 * @package WoltLabSuite\Core\Data\Modification\Log
19 * @method ModificationLog getDecoratedObject()
20 * @mixin ModificationLog
22 class ViewableConversationModificationLog
extends DatabaseObjectDecorator
24 use TLegacyUserPropertyAccess
;
29 protected static $baseClass = ModificationLog
::class;
35 protected $userProfile;
38 * Returns readable representation of current log entry.
42 public function __toString()
44 return WCF
::getLanguage()->getDynamicVariable(
45 'wcf.conversation.log.conversation.' . $this->action
,
46 ['additionalData' => $this->additionalData
]
51 * Returns the profile object of the user who created the modification entry.
55 public function getUserProfile()
57 if ($this->userProfile
=== null) {
59 $this->userProfile
= UserProfileRuntimeCache
::getInstance()->getObject($this->userID
);
61 $this->userProfile
= UserProfile
::getGuestUserProfile($this->username
);
65 return $this->userProfile
;