15 $currentUser = CurrentUser::get();
16 if ((
int)$currentUser->getId() ===
$userId)
18 $user = UserTable::wakeUpObject([
19 'ID' => $currentUser->getId(),
20 'LOGIN' => $currentUser->getLogin(),
21 'NAME' => $currentUser->getFirstName(),
22 'SECOND_NAME' => $currentUser->getSecondName(),
23 'LAST_NAME' => $currentUser->getLastName(),
24 'EMAIL' => $currentUser->getEmail(),
29 $user = UserTable::getByPrimary(
$userId)->fetchObject();
32 return $user ?
new static($user):
null;
47 return \CUser::FormatName(
48 \CSite::GetNameFormat(),
50 'LOGIN' => $this->user->getLogin(),
51 'NAME' => $this->user->getName(),
52 'LAST_NAME' => $this->user->getLastName(),
53 'SECOND_NAME' => $this->user->getSecondName(),
54 'EMAIL' => $this->user->getEmail(),
65 $photo = $this->user->getPersonalPhoto();
66 if (empty($photo) || $size <= 0)
71 $avatarId =
"{$photo}{$size}";
72 if (!isset($cache[$avatarId]))
74 $cache[$avatarId] =
'';
77 $originalFile = \CFile::getFileArray($photo);
79 if ($originalFile !==
false)
81 $resizedFile = \CFile::resizeImageGet(
93 $cache[$avatarId] = $resizedFile[
'src'];
98 return $cache[$avatarId];
107 'login' => $this->user->getLogin(),
108 'name' => $this->user->getName(),
109 'lastName' => $this->user->getLastName(),
110 'secondName' => $this->user->getSecondName(),
112 'workPosition' => $this->user->getWorkPosition(),
113 'link' =>
"/company/personal/user/{$userId}/",