From: Matthias Schmidt Date: Mon, 25 Jan 2021 15:05:43 +0000 (+0100) Subject: Stop using `TLegacyUserPropertyAccess` (and associated legacy `__get()`) X-Git-Tag: 5.4.0_Alpha_1~48 X-Git-Url: https://git.stricted.de/?p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.conversation.git;a=commitdiff_plain;h=381191f4f1e26cdfff406e4ac6240c063d816068 Stop using `TLegacyUserPropertyAccess` (and associated legacy `__get()`) Close #146 --- diff --git a/files/lib/data/conversation/ViewableConversation.class.php b/files/lib/data/conversation/ViewableConversation.class.php index 3d1877e..165c2ba 100644 --- a/files/lib/data/conversation/ViewableConversation.class.php +++ b/files/lib/data/conversation/ViewableConversation.class.php @@ -5,7 +5,6 @@ namespace wcf\data\conversation; use wcf\data\conversation\label\ConversationLabel; use wcf\data\conversation\label\ConversationLabelList; use wcf\data\DatabaseObjectDecorator; -use wcf\data\TLegacyUserPropertyAccess; use wcf\data\user\User; use wcf\data\user\UserProfile; use wcf\system\cache\runtime\UserProfileRuntimeCache; @@ -27,8 +26,6 @@ use wcf\system\WCF; */ class ViewableConversation extends DatabaseObjectDecorator { - use TLegacyUserPropertyAccess; - /** * participant summary * @var string @@ -64,49 +61,6 @@ class ViewableConversation extends DatabaseObjectDecorator */ protected static $baseClass = Conversation::class; - /** - * maps legacy direct access to last poster's user profile data to the real - * user profile property names - * @var string[] - * @deprecated - */ - protected static $__lastUserAvatarPropertyMapping = [ - 'lastPosterAvatarID' => 'avatarID', - 'lastPosterAvatarName' => 'avatarName', - 'lastPosterAvatarExtension' => 'avatarExtension', - 'lastPosterAvatarWidth' => 'width', - 'lastPosterAvatarHeight' => 'height', - 'lastPosterEmail' => 'email', - 'lastPosterDisableAvatar' => 'disableAvatar', - 'lastPosterEnableGravatar' => 'enableGravatar', - 'lastPosterGravatarFileExtension' => 'gravatarFileExtension', - 'lastPosterAvatarFileHash' => 'fileHash', - ]; - - /** - * @inheritDoc - * @deprecated - */ - public function __get($name) - { - $value = parent::__get($name); - if ($value !== null) { - return $value; - } elseif (\array_key_exists($name, $this->object->data)) { - return; - } - - /** @noinspection PhpVariableVariableInspection */ - $value = $this->getUserProfile()->{$name}; - if ($value !== null) { - return $value; - } - - if (isset(static::$__lastUserAvatarPropertyMapping[$name])) { - return $this->getLastPosterProfile()->getAvatar()->{static::$__lastUserAvatarPropertyMapping[$name]}; - } - } - /** * Returns the user profile object. * diff --git a/files/lib/data/conversation/message/ViewableConversationMessage.class.php b/files/lib/data/conversation/message/ViewableConversationMessage.class.php index e5023ed..2315d46 100644 --- a/files/lib/data/conversation/message/ViewableConversationMessage.class.php +++ b/files/lib/data/conversation/message/ViewableConversationMessage.class.php @@ -3,7 +3,6 @@ namespace wcf\data\conversation\message; use wcf\data\DatabaseObjectDecorator; -use wcf\data\TLegacyUserPropertyAccess; use wcf\data\user\UserProfile; use wcf\system\cache\runtime\UserProfileRuntimeCache; @@ -20,8 +19,6 @@ use wcf\system\cache\runtime\UserProfileRuntimeCache; */ class ViewableConversationMessage extends DatabaseObjectDecorator { - use TLegacyUserPropertyAccess; - /** * @inheritDoc */ diff --git a/files/lib/data/modification/log/ViewableConversationModificationLog.class.php b/files/lib/data/modification/log/ViewableConversationModificationLog.class.php index e745412..210e1e5 100644 --- a/files/lib/data/modification/log/ViewableConversationModificationLog.class.php +++ b/files/lib/data/modification/log/ViewableConversationModificationLog.class.php @@ -3,7 +3,6 @@ namespace wcf\data\modification\log; use wcf\data\DatabaseObjectDecorator; -use wcf\data\TLegacyUserPropertyAccess; use wcf\data\user\UserProfile; use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\WCF; @@ -21,8 +20,6 @@ use wcf\system\WCF; */ class ViewableConversationModificationLog extends DatabaseObjectDecorator { - use TLegacyUserPropertyAccess; - /** * @inheritDoc */