Add Setup::getUser() method
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 17 Nov 2020 13:59:48 +0000 (14:59 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 17 Nov 2020 15:27:03 +0000 (16:27 +0100)
wcfsetup/install/files/lib/system/user/multifactor/Setup.class.php

index edc54a6b04f13d07912ef7e83da1b8fe2d925e1d..c129893b8d2fe16e80b8be8ee839eaca52938fcb 100644 (file)
@@ -4,6 +4,7 @@ use wcf\data\IIDObject;
 use wcf\data\object\type\ObjectType;
 use wcf\data\object\type\ObjectTypeCache;
 use wcf\data\user\User;
+use wcf\system\cache\runtime\UserRuntimeCache;
 use wcf\system\WCF;
 
 /**
@@ -46,6 +47,13 @@ final class Setup implements IIDObject {
                return ObjectTypeCache::getInstance()->getObjectType($this->row['objectTypeID']);
        }
        
+       /**
+        * Returns the user.
+        */
+       public function getUser(): User {
+               return UserRuntimeCache::getInstance()->getObject($this->row['userID']);
+       }
+       
        /**
         * Locks the database record for this setup, preventing concurrent changes, and returns itself.
         */