2 namespace wcf\system\user\online\location
;
3 use wcf\data\user\online\UserOnline
;
4 use wcf\data\user\User
;
5 use wcf\data\user\UserList
;
9 * Implementation of IUserOnlineLocation for the user profile location.
12 * @copyright 2001-2016 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package com.woltlab.wcf
15 * @subpackage system.user.online.location
16 * @category Community Framework
17 * @deprecated since 2.2
19 class UserLocation
implements IUserOnlineLocation
{
24 protected $userIDs = [];
30 protected $users = null;
35 public function cache(UserOnline
$user) {
36 if ($user->objectID
) $this->userIDs
[] = $user->objectID
;
42 public function get(UserOnline
$user, $languageVariable = '') {
43 if ($this->users
=== null) {
47 if (!isset($this->users
[$user->objectID
])) {
51 return WCF
::getLanguage()->getDynamicVariable($languageVariable, ['user' => $this->users
[$user->objectID
]]);
57 protected function readUsers() {
60 if (empty($this->userIDs
)) return;
61 $this->userIDs
= array_unique($this->userIDs
);
63 $userList = new UserList();
64 $userList->setObjectIDs($this->userIDs
);
65 $userList->readObjects();
66 $this->users
= $userList->getObjects();