2 namespace wcf\data\modification\log
;
3 use wcf\data\user\UserProfile
;
4 use wcf\data\DatabaseObjectDecorator
;
5 use wcf\data\TLegacyUserPropertyAccess
;
6 use wcf\system\cache\runtime\UserProfileRuntimeCache
;
10 * Provides a viewable conversation modification log.
12 * @author Alexander Ebert
13 * @copyright 2001-2019 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15 * @package WoltLabSuite\Core\Data\Modification\Log
17 * @method ModificationLog getDecoratedObject()
18 * @mixin ModificationLog
20 class ViewableConversationModificationLog
extends DatabaseObjectDecorator
{
21 use TLegacyUserPropertyAccess
;
26 protected static $baseClass = ModificationLog
::class;
32 protected $userProfile;
35 * Returns readable representation of current log entry.
39 public function __toString() {
40 return WCF
::getLanguage()->getDynamicVariable('wcf.conversation.log.conversation.'.$this->action
, ['additionalData' => $this->additionalData
]);
44 * Returns the profile object of the user who created the modification entry.
48 public function getUserProfile() {
49 if ($this->userProfile
=== null) {
51 $this->userProfile
= UserProfileRuntimeCache
::getInstance()->getObject($this->userID
);
54 $this->userProfile
= UserProfile
::getGuestUserProfile($this->username
);
58 return $this->userProfile
;