use wcf\data\object\type\ObjectTypeCache;
use wcf\system\bbcode\BBCodeParser;
use wcf\system\bbcode\MessageParser;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\UserInputException;
if (count($this->objectIDs) != 1) {
throw new UserInputException('objectIDs');
}
- $this->userProfile = UserProfile::getUserProfile(reset($this->objectIDs));
+ $this->userProfile = UserProfileRuntimeCache::getInstance()->getObject(reset($this->objectIDs));
if ($this->userProfile === null) {
throw new UserInputException('objectIDs');
public function validateBeginEdit() {
if (!empty($this->objectIDs) && count($this->objectIDs) == 1) {
$userID = reset($this->objectIDs);
- $this->userProfile = UserProfile::getUserProfile($userID);
+ $this->userProfile = UserProfileRuntimeCache::getInstance()->getObject($userID);
}
if ($this->userProfile === null || !$this->userProfile->userID) {
namespace wcf\data\user\avatar;
use wcf\data\user\User;
use wcf\data\user\UserEditor;
-use wcf\data\user\UserProfile;
use wcf\data\AbstractDatabaseObjectAction;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\SystemException;
throw new PermissionDeniedException();
}
- if (!WCF::getSession()->getPermission('user.profile.avatar.canUploadAvatar') || UserProfile::getUserProfile($this->avatar->userID)->disableAvatar) {
+ if (!WCF::getSession()->getPermission('user.profile.avatar.canUploadAvatar') || UserProfileRuntimeCache::getInstance()->getObject($this->avatar->userID)->disableAvatar) {
throw new PermissionDeniedException();
}
use wcf\data\user\UserProfile;
use wcf\data\AbstractDatabaseObjectAction;
use wcf\data\IGroupedUserListAction;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\UserInputException;
use wcf\system\user\activity\event\UserActivityEventHandler;
/**
* user profile object
- * @var \wcf\data\user\UserProfile;
+ * @var UserProfile;
*/
public $userProfile = null;
$this->readInteger('pageNo');
$this->readInteger('userID');
- $this->userProfile = UserProfile::getUserProfile($this->parameters['userID']);
+ $this->userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['userID']);
if ($this->userProfile->isProtected()) {
throw new PermissionDeniedException();
}
<?php
namespace wcf\data\user\follow;
-use wcf\data\user\UserProfile;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\user\GroupedUserList;
use wcf\system\WCF;
$this->readInteger('pageNo');
$this->readInteger('userID');
- $this->userProfile = UserProfile::getUserProfile($this->parameters['userID']);
+ $this->userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['userID']);
if ($this->userProfile->isProtected()) {
throw new PermissionDeniedException();
}
<?php
namespace wcf\data\user\ignore;
-use wcf\data\user\UserProfile;
use wcf\data\AbstractDatabaseObjectAction;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\UserInputException;
public function validateIgnore() {
$this->readInteger('ignoreUserID', false, 'data');
- $userProfile = UserProfile::getUserProfile($this->parameters['data']['ignoreUserID']);
+ $userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['data']['ignoreUserID']);
if ($userProfile === null || $userProfile->userID == WCF::getUser()->userID) {
throw new IllegalLinkException();
}
public function validateUnignore() {
$this->readInteger('ignoreUserID', false, 'data');
- $userProfile = UserProfile::getUserProfile($this->parameters['data']['ignoreUserID']);
+ $userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['data']['ignoreUserID']);
if ($userProfile === null) {
throw new IllegalLinkException();
}
use wcf\data\user\UserProfile;
use wcf\data\AbstractDatabaseObjectAction;
use wcf\data\IGroupedUserListAction;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\user\GroupedUserList;
use wcf\system\WCF;
/**
* user profile object
- * @var \wcf\data\user\UserProfile;
+ * @var UserProfile;
*/
public $userProfile = null;
$this->readInteger('pageNo');
$this->readInteger('userID');
- $this->userProfile = UserProfile::getUserProfile($this->parameters['userID']);
+ $this->userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['userID']);
if ($this->userProfile->isProtected()) {
throw new PermissionDeniedException();
}
<?php
namespace wcf\form;
use wcf\data\user\UserProfile;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\UserInputException;
/**
* recipient's user object
- * @var \wcf\data\user\UserProfile
+ * @var UserProfile
*/
public $user = 0;
parent::readParameters();
if (isset($_REQUEST['id'])) $this->userID = intval($_REQUEST['id']);
- $this->user = UserProfile::getUserProfile($this->userID);
+ $this->user = UserProfileRuntimeCache::getInstance()->getObject($this->userID);
if ($this->user === null) {
throw new IllegalLinkException();
}
use wcf\data\user\UserEditor;
use wcf\data\user\UserProfile;
use wcf\system\breadcrumb\Breadcrumb;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\menu\user\profile\UserProfileMenu;
/**
* user object
- * @var \wcf\data\user\UserProfile
+ * @var UserProfile
*/
public $user = null;
parent::readParameters();
if (isset($_REQUEST['id'])) $this->userID = intval($_REQUEST['id']);
- $this->user = UserProfile::getUserProfile($this->userID);
+ $this->user = UserProfileRuntimeCache::getInstance()->getObject($this->userID);
if ($this->user === null) {
throw new IllegalLinkException();
}
use wcf\data\comment\Comment;
use wcf\data\comment\CommentList;
use wcf\data\object\type\ObjectTypeCache;
-use wcf\data\user\UserProfile;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\like\IViewableLikeProvider;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
*/
public function isAccessible($objectID, $validateWritePermission = false) {
// check object id
- $userProfile = UserProfile::getUserProfile($objectID);
+ $userProfile = UserProfileRuntimeCache::getInstance()->getObject($objectID);
if ($userProfile === null) {
return false;
}
}
}
if (!empty($userIDs)) {
- $users = UserProfile::getUserProfiles(array_unique($userIDs));
+ $users = UserProfileRuntimeCache::getInstance()->getObjects(array_unique($userIDs));
}
// set message
use wcf\data\user\UserEditor;
use wcf\data\user\UserList;
use wcf\data\user\UserProfile;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\mail\Mail;
use wcf\system\user\notification\UserNotificationHandler;
}
// load authors
- $authors = UserProfile::getUserProfiles($authorIDs);
+ $authors = UserProfileRuntimeCache::getInstance()->getObjects($authorIDs);
$unknownAuthor = new UserProfile(new User(null, array('userID' => null, 'username' => WCF::getLanguage()->get('wcf.user.guest'))));
// load objects associated with each object type
<?php
namespace wcf\system\message\quote;
-use wcf\data\user\UserProfile;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
if (!empty($userIDs)) {
$userIDs = array_unique($userIDs);
- $userProfiles = UserProfile::getUserProfiles($userIDs);
+ $userProfiles = UserProfileRuntimeCache::getInstance()->getObjects($userIDs);
}
WCF::getTPL()->assign(array(
use wcf\data\user\UserEditor;
use wcf\data\user\UserProfile;
use wcf\system\cache\builder\UserNotificationEventCacheBuilder;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
$userProfile = new UserProfile(WCF::getUser());
}
else {
- $userProfile = UserProfile::getUserProfile($notificationObject->getAuthorID());
+ $userProfile = UserProfileRuntimeCache::getInstance()->getObject($notificationObject->getAuthorID());
}
}
if ($userProfile === null) {