Add php doc to `SetAvatar`
authorCyperghost <olaf_schmitz_1@t-online.de>
Fri, 8 Nov 2024 11:49:35 +0000 (12:49 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 8 Nov 2024 11:49:35 +0000 (12:49 +0100)
wcfsetup/install/files/lib/system/user/command/SetAvatar.class.php

index 2a2e854d574ccca77cb76e51399bd362ee85b5c0..823d4234dbbf70da8ca30d2020939b96c0c9d0df 100644 (file)
@@ -4,7 +4,6 @@ namespace wcf\system\user\command;
 
 use wcf\data\file\File;
 use wcf\data\file\FileAction;
-use wcf\data\user\avatar\UserAvatarAction;
 use wcf\data\user\User;
 use wcf\data\user\UserEditor;
 use wcf\system\user\group\assignment\UserGroupAssignmentHandler;
@@ -12,6 +11,14 @@ use wcf\system\user\storage\UserStorageHandler;
 use wcf\system\user\UserProfileHandler;
 use wcf\system\WCF;
 
+/**
+ * Sets the avatar of a user.
+ *
+ * @author      Olaf Braun
+ * @copyright   2001-2024 WoltLab GmbH
+ * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since       6.2
+ */
 final class SetAvatar
 {
     public function __construct(
@@ -26,11 +33,6 @@ final class SetAvatar
             (new FileAction([$this->user->avatarFileID], 'delete'))->executeAction();
         }
 
-        // Delete old `UserAvatar` object if provided
-        if ($this->user->avatarID) {
-            (new UserAvatarAction([$this->user->avatarID], 'delete'))->executeAction();
-        }
-
         (new UserEditor($this->user))->update([
             'avatarFileID' => $this->file?->fileID,
             'avatarID' => null,