- Модуль: catalogmobile
- Путь к файлу: ~/bitrix/modules/catalogmobile/lib/EntityEditor/StoreDocumentProvider.php
- Класс: BitrixCatalogMobileEntityEditorStoreDocumentProvider
- Вызов: StoreDocumentProvider::getAdditionalUserData
protected function getAdditionalUserData(array $document, array $userFields, array $usersInfo): array
{
foreach ($userFields as $fieldName => $userId)
{
if (!$userId || empty($usersInfo[$userId]))
{
continue;
}
$user = $usersInfo[$userId];
$userName = CUser::FormatName(
CSite::GetNameFormat(false),
[
'LOGIN' => $user['LOGIN'],
'NAME' => $user['NAME'],
'LAST_NAME' => $user['LAST_NAME'],
'SECOND_NAME' => $user['SECOND_NAME'],
],
true,
false
);
$imageUrl = null;
if ((int)$user['PERSONAL_PHOTO'] > 0)
{
$fileInfo = CFile::ResizeImageGet(
(int)$user['PERSONAL_PHOTO'],
[
'width' => 60,
'height' => 60,
],
BX_RESIZE_IMAGE_EXACT
);
if (isset($fileInfo['src']))
{
$imageUrl = $fileInfo['src'];
}
}
$document[$fieldName . self::ENTITY_LIST_POSTFIX] = [
[
'id' => (int)$user['ID'],
'title' => $userName,
'imageUrl' => $imageUrl,
],
];
}
return $document;
}